IpProtocol

class aws_cdk.aws_ec2.IpProtocol(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

The types of IP addresses provisioned in the VPC.

ExampleMetadata:

infused

Example:

import aws_cdk.aws_elasticloadbalancingv2 as elbv2


# The VPC and subnet must have associated IPv6 CIDR blocks.
vpc = ec2.Vpc(self, "Vpc",
    ip_protocol=ec2.IpProtocol.DUAL_STACK
)
cluster = ecs.Cluster(self, "EcsCluster", vpc=vpc)

network_loadbalanced_fargate_service = ecs_patterns.NetworkLoadBalancedFargateService(self, "NlbFargateService",
    cluster=cluster,
    task_image_options=ecsPatterns.NetworkLoadBalancedTaskImageOptions(
        image=ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample")
    ),
    ip_address_type=elbv2.IpAddressType.DUAL_STACK
)

network_loadbalanced_ec2_service = ecs_patterns.NetworkLoadBalancedEc2Service(self, "NlbEc2Service",
    cluster=cluster,
    task_image_options=ecsPatterns.NetworkLoadBalancedTaskImageOptions(
        image=ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample")
    ),
    ip_address_type=elbv2.IpAddressType.DUAL_STACK
)

Attributes

DUAL_STACK

The vpc will have both IPv4 and IPv6 addresses.

Unless specified, public IPv4 addresses will not be auto assigned, an egress only internet gateway (EIGW) will be created and configured, and NATs and internet gateways (IGW) will be configured with IPv6 addresses.

IPV4_ONLY

The vpc will be configured with only IPv4 addresses.

This is the default protocol if unset.