Class VPCPeeringConnection
(experimental) Creates a peering connection between two VPCs.
Inherited Members
Namespace: Amazon.CDK.AWS.ec2.Alpha
Assembly: Amazon.CDK.AWS.ec2.Alpha.dll
Syntax (csharp)
public class VPCPeeringConnection : Resource, IResource, IConstruct, IEnvironmentAware, IRouteTarget, IDependable
Syntax (vb)
Public Class VPCPeeringConnection Inherits Resource Implements IResource, IConstruct, IEnvironmentAware, IRouteTarget, IDependable
Remarks
Stability: Experimental
Resource: AWS::EC2::VPCPeeringConnection
ExampleMetadata: infused
Examples
var stack = new Stack();
var acceptorVpc = new VpcV2(this, "VpcA", new VpcV2Props {
PrimaryAddressBlock = IpAddresses.Ipv4("10.0.0.0/16")
});
var requestorVpc = new VpcV2(this, "VpcB", new VpcV2Props {
PrimaryAddressBlock = IpAddresses.Ipv4("10.1.0.0/16")
});
var peeringConnection = requestorVpc.CreatePeeringConnection("peeringConnection", new VPCPeeringConnectionOptions {
AcceptorVpc = acceptorVpc
});
var routeTable = new RouteTable(this, "RouteTable", new RouteTableProps {
Vpc = requestorVpc
});
routeTable.AddRoute("vpcPeeringRoute", "10.0.0.0/16", new Dictionary<string, IRouteTarget?> { { "gateway", peeringConnection } });
Synopsis
Constructors
| VPCPeeringConnection(Construct, string, IVPCPeeringConnectionProps) | (experimental) Creates a peering connection between two VPCs. |
Properties
| PROPERTY_INJECTION_ID | (experimental) Uniquely identifies this class. |
| Resource | (experimental) The VPC peering connection CFN resource. |
| RouterTargetId | (experimental) The ID of the route target. |
| RouterType | (experimental) The type of router used in the route. |
Constructors
VPCPeeringConnection(Construct, string, IVPCPeeringConnectionProps)
(experimental) Creates a peering connection between two VPCs.
public VPCPeeringConnection(Construct scope, string id, IVPCPeeringConnectionProps props)
Parameters
- scope Construct
- id string
- props IVPCPeeringConnectionProps
Remarks
Stability: Experimental
Properties
PROPERTY_INJECTION_ID
(experimental) Uniquely identifies this class.
public static string PROPERTY_INJECTION_ID { get; }
Property Value
Remarks
Stability: Experimental
Resource
(experimental) The VPC peering connection CFN resource.
public virtual CfnVPCPeeringConnection Resource { get; }
Property Value
Remarks
Stability: Experimental
RouterTargetId
(experimental) The ID of the route target.
public virtual string RouterTargetId { get; }
Property Value
Remarks
Stability: Experimental
RouterType
(experimental) The type of router used in the route.
public virtual RouterType RouterType { get; }
Property Value
Remarks
Stability: Experimental