NatTrafficDirection

class aws_cdk.aws_ec2.NatTrafficDirection(value)

Bases: Enum

Direction of traffic to allow all by default.

ExampleMetadata:

infused

Example:

# instance_type: ec2.InstanceType


provider = ec2.NatProvider.instance(
    instance_type=instance_type,
    default_allowed_traffic=ec2.NatTrafficDirection.OUTBOUND_ONLY
)
ec2.Vpc(self, "TheVPC",
    nat_gateway_provider=provider
)
provider.connections.allow_from(ec2.Peer.ipv4("1.2.3.4/8"), ec2.Port.tcp(80))

Attributes

INBOUND_AND_OUTBOUND

Allow all outbound and inbound traffic.

NONE

Disallow all outbound and inbound traffic.

OUTBOUND_ONLY

Allow all outbound traffic and disallow all inbound traffic.