SubnetType

class aws_cdk.aws_ec2.SubnetType

Bases: enum.Enum

The type of Subnet.

Attributes

ISOLATED

Isolated Subnets do not route traffic to the Internet (in this VPC).

This can be good for subnets with RDS or Elasticache instances, or which route Internet traffic through a peer VPC.

PRIVATE

Subnet that routes to the internet, but not vice versa.

Instances in a private subnet can connect to the Internet, but will not allow connections to be initiated from the Internet. Internet traffic will be routed via a NAT Gateway.

Normally a Private subnet will use a NAT gateway in the same AZ, but if natGateways is used to reduce the number of NAT gateways, a NAT gateway from another AZ will be used instead.

PUBLIC

Subnet connected to the Internet.

Instances in a Public subnet can connect to the Internet and can be connected to from the Internet as long as they are launched with public IPs (controlled on the AutoScalingGroup or other constructs that launch instances).

Public subnets route outbound traffic via an Internet Gateway.

Attributes

ISOLATED = 'ISOLATED'

Isolated Subnets do not route traffic to the Internet (in this VPC).

This can be good for subnets with RDS or Elasticache instances, or which route Internet traffic through a peer VPC.

PRIVATE = 'PRIVATE'

Subnet that routes to the internet, but not vice versa.

Instances in a private subnet can connect to the Internet, but will not allow connections to be initiated from the Internet. Internet traffic will be routed via a NAT Gateway.

Normally a Private subnet will use a NAT gateway in the same AZ, but if natGateways is used to reduce the number of NAT gateways, a NAT gateway from another AZ will be used instead.

PUBLIC = 'PUBLIC'

Subnet connected to the Internet.

Instances in a Public subnet can connect to the Internet and can be connected to from the Internet as long as they are launched with public IPs (controlled on the AutoScalingGroup or other constructs that launch instances).

Public subnets route outbound traffic via an Internet Gateway.