Show / Hide Table of Contents

Class AddRouteOptions

Options for adding a new route to a subnet.

Inheritance
object
AddRouteOptions
Implements
IAddRouteOptions
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class AddRouteOptions : IAddRouteOptions
Syntax (vb)
Public Class AddRouteOptions 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

AddRouteOptions()

Options for adding a new route to a subnet.

Properties

DestinationCidrBlock

IPv4 range this route applies to.

DestinationIpv6CidrBlock

IPv6 range this route applies to.

EnablesInternetConnectivity

Whether this route will enable internet connectivity.

RouterId

The ID of the router.

RouterType

What type of router to route this traffic to.

Constructors

AddRouteOptions()

Options for adding a new route to a subnet.

public AddRouteOptions()
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"
            });

Properties

DestinationCidrBlock

IPv4 range this route applies to.

public string? DestinationCidrBlock { get; set; }
Property Value

string

Remarks

Default: '0.0.0.0/0'

DestinationIpv6CidrBlock

IPv6 range this route applies to.

public string? DestinationIpv6CidrBlock { get; set; }
Property Value

string

Remarks

Default: - Uses IPv6

EnablesInternetConnectivity

Whether this route will enable internet connectivity.

public bool? EnablesInternetConnectivity { get; set; }
Property Value

bool?

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

string

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

RouterType

Remarks

ExampleMetadata: infused

Implements

IAddRouteOptions
Back to top Generated by DocFX