EgressOnlyInternetGatewayOptions

class aws_cdk.aws_ec2_alpha.EgressOnlyInternetGatewayOptions(*, destination=None, subnets=None)

Bases: object

(experimental) Options to define EgressOnlyInternetGateway for VPC.

Parameters:
  • destination (Optional[str]) – (experimental) Destination Ipv6 address for EGW route. Default: - ‘::/0’ all Ipv6 traffic

  • subnets (Optional[Sequence[Union[SubnetSelection, Dict[str, Any]]]]) – (experimental) List of subnets where route to EGW will be added. Default: - no route created

Stability:

experimental

ExampleMetadata:

infused

Example:

stack = Stack()
my_vpc = VpcV2(self, "Vpc",
    primary_address_block=IpAddresses.ipv4("10.1.0.0/16"),
    secondary_address_blocks=[IpAddresses.amazon_provided_ipv6(
        cidr_block_name="AmazonProvided"
    )]
)
route_table = RouteTable(self, "RouteTable",
    vpc=my_vpc
)
subnet = SubnetV2(self, "Subnet",
    vpc=my_vpc,
    availability_zone="eu-west-2a",
    ipv4_cidr_block=IpCidr("10.0.0.0/24"),
    ipv6_cidr_block=IpCidr("2001:db8:1::/64"),
    subnet_type=SubnetType.PRIVATE
)

my_vpc.add_egress_only_internet_gateway(
    subnets=[ec2.SubnetSelection(subnet_type=SubnetType.PRIVATE)],
    destination="::/60"
)

Attributes

destination

(experimental) Destination Ipv6 address for EGW route.

Default:
  • ‘::/0’ all Ipv6 traffic

Stability:

experimental

subnets

(experimental) List of subnets where route to EGW will be added.

Default:
  • no route created

Stability:

experimental