Skip to content

assign_ipv6_addresses async

assign_ipv6_addresses(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    ipv6_prefix_count: Optional[Integer] = None,
    ipv6_prefixes: Optional[IpPrefixList] = None,
    network_interface_id: Optional[NetworkInterfaceId] = None,
    ipv6_addresses: Optional[Ipv6AddressList] = None,
    ipv6_address_count: Optional[Integer] = None,
) -> AssignIpv6AddressesResult

Assigns the specified IPv6 addresses to the specified network interface. You can specify specific IPv6 addresses, or you can specify the number of IPv6 addresses to be automatically assigned from the subnet's IPv6 CIDR block range. You can assign as many IPv6 addresses to a network interface as you can assign private IPv4 addresses, and the limit varies by instance type.

You must specify either the IPv6 addresses or the IPv6 address count in the request.

You can optionally use Prefix Delegation on the network interface. You must specify either the IPV6 Prefix Delegation prefixes, or the IPv6 Prefix Delegation count. For information, see Assigning prefixes to network interfaces in the Amazon EC2 User Guide.

Parameters:

  • ipv6_prefix_count (Optional[Integer], default: None ) –

    The number of IPv6 prefixes that Amazon Web Services automatically assigns to the network interface. You cannot use this option if you use the Ipv6Prefixes option.

  • ipv6_prefixes (Optional[IpPrefixList], default: None ) –

    One or more IPv6 prefixes assigned to the network interface. You can't use this option if you use the Ipv6PrefixCount option.

  • network_interface_id (Optional[NetworkInterfaceId], default: None ) –

    The ID of the network interface.

  • ipv6_addresses (Optional[Ipv6AddressList], default: None ) –

    The IPv6 addresses to be assigned to the network interface. You can't use this option if you're specifying a number of IPv6 addresses.

  • ipv6_address_count (Optional[Integer], default: None ) –

    The number of additional IPv6 addresses to assign to the network interface. The specified number of IPv6 addresses are assigned in addition to the existing IPv6 addresses that are already assigned to the network interface. Amazon EC2 automatically selects the IPv6 addresses from the subnet range. You can't use this option if specifying specific IPv6 addresses.

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def assign_ipv6_addresses(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    ipv6_prefix_count: Optional["capo_ec2.types.integer.Integer"] = None,
    ipv6_prefixes: Optional["capo_ec2.types.ip_prefix_list.IpPrefixList"] = None,
    network_interface_id: Optional[
        "capo_ec2.types.network_interface_id.NetworkInterfaceId"
    ] = None,
    ipv6_addresses: Optional[
        "capo_ec2.types.ipv6_address_list.Ipv6AddressList"
    ] = None,
    ipv6_address_count: Optional["capo_ec2.types.integer.Integer"] = None,
) -> "capo_ec2.types.assign_ipv6_addresses_result.AssignIpv6AddressesResult":
    """<p>Assigns the specified IPv6 addresses to the specified network interface. You can specify specific IPv6 addresses, or you can specify the number of IPv6 addresses to be automatically assigned from the subnet's IPv6 CIDR block range. You can assign as many IPv6 addresses to a network interface as you can assign private IPv4 addresses, and the limit varies by instance type.</p> <p>You must specify either the IPv6 addresses or the IPv6 address count in the request. </p> <p>You can optionally use Prefix Delegation on the network interface. You must specify either the IPV6 Prefix Delegation prefixes, or the IPv6 Prefix Delegation count. For information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-prefix-eni.html"> Assigning prefixes to network interfaces</a> in the <i>Amazon EC2 User Guide</i>.</p>

    Args:
        ipv6_prefix_count: <p>The number of IPv6 prefixes that Amazon Web Services automatically assigns to the network interface. You cannot use this option if you use the <code>Ipv6Prefixes</code> option.</p>
        ipv6_prefixes: <p>One or more IPv6 prefixes assigned to the network interface. You can't use this option if you use the <code>Ipv6PrefixCount</code> option.</p>
        network_interface_id: <p>The ID of the network interface.</p>
        ipv6_addresses: <p>The IPv6 addresses to be assigned to the network interface. You can't use this option if you're specifying a number of IPv6 addresses.</p>
        ipv6_address_count: <p>The number of additional IPv6 addresses to assign to the network interface. The specified number of IPv6 addresses are assigned in addition to the existing IPv6 addresses that are already assigned to the network interface. Amazon EC2 automatically selects the IPv6 addresses from the subnet range. You can't use this option if specifying specific IPv6 addresses.</p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.assign_ipv6_addresses_request.AssignIpv6AddressesRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.assign_ipv6_addresses_result.AssignIpv6AddressesResult"
    ]:
        import capo_ec2._operations.amazon_ec2.assign_ipv6_addresses

        (
            output,
            http_response,
        ) = await capo_ec2._operations.amazon_ec2.assign_ipv6_addresses.async_assign_ipv6_addresses(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AssignIpv6Addresses")
    )
    input_: capo_ec2.types.assign_ipv6_addresses_request.AssignIpv6AddressesRequest = {}
    if ipv6_prefix_count is not None:
        input_["ipv6_prefix_count"] = ipv6_prefix_count
    if ipv6_prefixes is not None:
        input_["ipv6_prefixes"] = ipv6_prefixes
    if network_interface_id is not None:
        input_["network_interface_id"] = network_interface_id
    if ipv6_addresses is not None:
        input_["ipv6_addresses"] = ipv6_addresses
    if ipv6_address_count is not None:
        input_["ipv6_address_count"] = ipv6_address_count

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output