Skip to content

move_address_to_vpc async

move_address_to_vpc(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    public_ip: Optional[String] = None,
) -> MoveAddressToVpcResult

This action is deprecated.

Moves an Elastic IP address from the EC2-Classic platform to the EC2-VPC platform. The Elastic IP address must be allocated to your account for more than 24 hours, and it must not be associated with an instance. After the Elastic IP address is moved, it is no longer available for use in the EC2-Classic platform. You cannot move an Elastic IP address that was originally allocated for use in the EC2-VPC platform to the EC2-Classic platform.

Parameters:

  • dry_run (Optional[Boolean], default: None ) –

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • public_ip (Optional[String], default: None ) –

    The Elastic IP address.

Raises:

Examples:

To move an address to EC2-VPC This example moves the specified Elastic IP address to the EC2-VPC platform.

>>> await client.move_address_to_vpc(public_ip='54.123.4.56')
Source code in docs_src/capo_ec2/_services/async_ec2.py
async def move_address_to_vpc(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    public_ip: Optional["capo_ec2.types.string.String"] = None,
) -> "capo_ec2.types.move_address_to_vpc_result.MoveAddressToVpcResult":
    """<note> <p>This action is deprecated.</p> </note> <p>Moves an Elastic IP address from the EC2-Classic platform to the EC2-VPC platform. The Elastic IP address must be allocated to your account for more than 24 hours, and it must not be associated with an instance. After the Elastic IP address is moved, it is no longer available for use in the EC2-Classic platform. You cannot move an Elastic IP address that was originally allocated for use in the EC2-VPC platform to the EC2-Classic platform.</p>

    Args:
        dry_run: <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
        public_ip: <p>The Elastic IP address.</p>

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

    Examples:
        To move an address to EC2-VPC
        This example moves the specified Elastic IP address to the EC2-VPC platform.

        >>> await client.move_address_to_vpc(public_ip='54.123.4.56')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.move_address_to_vpc_request.MoveAddressToVpcRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.move_address_to_vpc_result.MoveAddressToVpcResult"
    ]:
        import capo_ec2._operations.amazon_ec2.move_address_to_vpc

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("MoveAddressToVpc")
    )
    input_: capo_ec2.types.move_address_to_vpc_request.MoveAddressToVpcRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if public_ip is not None:
        input_["public_ip"] = public_ip

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