Skip to content

EC2  >  Operations  >  associate_vpc_cidr_block

associate_vpc_cidr_block

Operation

associate_vpc_cidr_block async

associate_vpc_cidr_block(request: AssociateVpcCidrBlockInput | AssociateVpcCidrBlockInputDict, /, *, plugins: list[Plugin] | None = None) -> AssociateVpcCidrBlockOutput
associate_vpc_cidr_block(*, plugins: list[Plugin] | None = None, **kwargs: Unpack[AssociateVpcCidrBlockInputDict]) -> AssociateVpcCidrBlockOutput

Associates a CIDR block with your VPC. You can associate a secondary IPv4 CIDR block, an Amazon-provided IPv6 CIDR block, or an IPv6 CIDR block from an IPv6 address pool that you provisioned through bring your own IP addresses (BYOIP).

You must specify one of the following in the request: an IPv4 CIDR block, an IPv6 pool, or an Amazon-provided IPv6 CIDR block.

For more information about associating CIDR blocks with your VPC and applicable restrictions, see IP addressing for your VPCs and subnets in the Amazon VPC User Guide.

Parameters:

Name Type Description Default
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
AssociateVpcCidrBlockOutput

An instance of AssociateVpcCidrBlockOutput.

Input

Pass the input fields as keyword arguments, or pass a model or dictionary as the first positional argument. Pass plugins separately as a keyword argument.

Model

AssociateVpcCidrBlockInput dataclass

Bases: _SerdeShape

Dataclass for AssociateVpcCidrBlockInput structure.

Attributes
amazon_provided_ipv6_cidr_block class-attribute instance-attribute
amazon_provided_ipv6_cidr_block: bool | None = ...

Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IPv6 addresses or the size of the CIDR block.

cidr_block class-attribute instance-attribute
cidr_block: str | None = ...

An IPv4 CIDR block to associate with the VPC.

ipv4_ipam_pool_id class-attribute instance-attribute
ipv4_ipam_pool_id: str | None = ...

Associate a CIDR allocated from an IPv4 IPAM pool to a VPC. For more information about Amazon VPC IP Address Manager (IPAM), see What is IPAM? in the Amazon VPC IPAM User Guide.

ipv4_netmask_length class-attribute instance-attribute
ipv4_netmask_length: int | None = ...

The netmask length of the IPv4 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see What is IPAM? in the Amazon VPC IPAM User Guide.

ipv6_cidr_block class-attribute instance-attribute
ipv6_cidr_block: str | None = ...

An IPv6 CIDR block from the IPv6 address pool. You must also specify Ipv6Pool in the request.

To let Amazon choose the IPv6 CIDR block for you, omit this parameter.

ipv6_cidr_block_network_border_group class-attribute instance-attribute
ipv6_cidr_block_network_border_group: str | None = ...

The name of the location from which we advertise the IPV6 CIDR block. Use this parameter to limit the CIDR block to this location.

You must set AmazonProvidedIpv6CidrBlock to true to use this parameter.

You can have one IPv6 CIDR block association per network border group.

ipv6_ipam_pool_id class-attribute instance-attribute
ipv6_ipam_pool_id: str | None = ...

Associates a CIDR allocated from an IPv6 IPAM pool to a VPC. For more information about Amazon VPC IP Address Manager (IPAM), see What is IPAM? in the Amazon VPC IPAM User Guide.

ipv6_netmask_length class-attribute instance-attribute
ipv6_netmask_length: int | None = ...

The netmask length of the IPv6 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see What is IPAM? in the Amazon VPC IPAM User Guide.

ipv6_pool class-attribute instance-attribute
ipv6_pool: str | None = ...

The ID of an IPv6 address pool from which to allocate the IPv6 CIDR block.

vpc_id class-attribute instance-attribute
vpc_id: str | None = ...

The ID of the VPC.

Dictionaries

AssociateVpcCidrBlockInputDict

Bases: TypedDict

Dictionary form of AssociateVpcCidrBlockInput.

Attributes
amazon_provided_ipv6_cidr_block instance-attribute
amazon_provided_ipv6_cidr_block: bool | None

Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IPv6 addresses or the size of the CIDR block.

cidr_block instance-attribute
cidr_block: str | None

An IPv4 CIDR block to associate with the VPC.

ipv4_ipam_pool_id instance-attribute
ipv4_ipam_pool_id: str | None

Associate a CIDR allocated from an IPv4 IPAM pool to a VPC. For more information about Amazon VPC IP Address Manager (IPAM), see What is IPAM? in the Amazon VPC IPAM User Guide.

ipv4_netmask_length instance-attribute
ipv4_netmask_length: int | None

The netmask length of the IPv4 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see What is IPAM? in the Amazon VPC IPAM User Guide.

ipv6_cidr_block instance-attribute
ipv6_cidr_block: str | None

An IPv6 CIDR block from the IPv6 address pool. You must also specify Ipv6Pool in the request.

To let Amazon choose the IPv6 CIDR block for you, omit this parameter.

ipv6_cidr_block_network_border_group instance-attribute
ipv6_cidr_block_network_border_group: str | None

The name of the location from which we advertise the IPV6 CIDR block. Use this parameter to limit the CIDR block to this location.

You must set AmazonProvidedIpv6CidrBlock to true to use this parameter.

You can have one IPv6 CIDR block association per network border group.

ipv6_ipam_pool_id instance-attribute
ipv6_ipam_pool_id: str | None

Associates a CIDR allocated from an IPv6 IPAM pool to a VPC. For more information about Amazon VPC IP Address Manager (IPAM), see What is IPAM? in the Amazon VPC IPAM User Guide.

ipv6_netmask_length instance-attribute
ipv6_netmask_length: int | None

The netmask length of the IPv6 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see What is IPAM? in the Amazon VPC IPAM User Guide.

ipv6_pool instance-attribute
ipv6_pool: str | None

The ID of an IPv6 address pool from which to allocate the IPv6 CIDR block.

vpc_id instance-attribute
vpc_id: Required[str]

The ID of the VPC.

Output

AssociateVpcCidrBlockOutput dataclass

Bases: _SerdeShape

Dataclass for AssociateVpcCidrBlockOutput structure.

Attributes

cidr_block_association class-attribute instance-attribute
cidr_block_association: VpcCidrBlockAssociation | None = ...

Information about the IPv4 CIDR block association.

ipv6_cidr_block_association class-attribute instance-attribute
ipv6_cidr_block_association: VpcIpv6CidrBlockAssociation | None = ...

Information about the IPv6 CIDR block association.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.

vpc_id class-attribute instance-attribute
vpc_id: str | None = ...

The ID of the VPC.