Class AddRouteOptions
Options for adding a new route to a subnet.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class AddRouteOptions : Object, IAddRouteOptions
Syntax (vb)
Public Class AddRouteOptions
Inherits Object
Implements IAddRouteOptions
Remarks
ExampleMetadata: infused
Examples
var vpc = new Vpc(this, "VPC", new VpcProps {
SubnetConfiguration = new [] { new SubnetConfiguration {
SubnetType = SubnetType.PUBLIC,
Name = "Public"
}, new SubnetConfiguration {
SubnetType = SubnetType.PRIVATE_ISOLATED,
Name = "Isolated"
} }
});
((Subnet)vpc.IsolatedSubnets[0]).AddRoute("StaticRoute", new AddRouteOptions {
RouterId = vpc.InternetGatewayId,
RouterType = RouterType.GATEWAY,
DestinationCidrBlock = "8.8.8.8/32"
});
Synopsis
Constructors
Add |
Properties
Destination |
IPv4 range this route applies to. |
Destination |
IPv6 range this route applies to. |
Enables |
Whether this route will enable internet connectivity. |
Router |
The ID of the router. |
Router |
What type of router to route this traffic to. |
Constructors
AddRouteOptions()
public AddRouteOptions()
Properties
DestinationCidrBlock
IPv4 range this route applies to.
public string DestinationCidrBlock { get; set; }
Property Value
System.
Remarks
Default: '0.0.0.0/0'
DestinationIpv6CidrBlock
IPv6 range this route applies to.
public string DestinationIpv6CidrBlock { get; set; }
Property Value
System.
Remarks
Default: - Uses IPv6
EnablesInternetConnectivity
Whether this route will enable internet connectivity.
public Nullable<bool> EnablesInternetConnectivity { get; set; }
Property Value
System.
Remarks
If true, this route will be added before any AWS resources that depend on internet connectivity in the VPC will be created.
Default: false
RouterId
The ID of the router.
public string RouterId { get; set; }
Property Value
System.
Remarks
Can be an instance ID, gateway ID, etc, depending on the router type.
RouterType
What type of router to route this traffic to.
public RouterType RouterType { get; set; }
Property Value