How do I transfer an Elastic IP address between accounts in the same Region?

4 minute read
2

I use an Elastic IP address in Amazon Elastic Compute Cloud (Amazon EC2). I want to transfer the IP address to another AWS account.

Resolution

Note: If you receive errors when you run AWS Command Line Interface (AWS CLI) commands, then see Troubleshooting errors for the AWS CLI. Also, make sure that you're using the most recent AWS CLI version.

To transfer Elastic IP addresses between accounts in the same AWS Region, use the Amazon EC2 console or the AWS CLI. When you use the AWS CLI, you can transfer only one Elastic IP address at a time.

When you transfer an Elastic IP address, there's a two-step handshake between the source account and transfer account. The source account can be a standard account or an AWS Organizations account. When the source account starts the transfer, the transfer account has 7 days to accept it. Otherwise, the Elastic IP address returns to its original owner.

AWS doesn't inform the transfer account about pending Elastic IP address transfer requests. The source account owner must communicate the request to the transfer account owner.

Amazon EC2 console

Use the Amazon EC2 console to transfer the Elastic IP address. After you send the transfer request, make sure that the transfer account owner accepts the Elastic IP address.

AWS CLI

Note: In the following commands, replace ELASTIC_IP with your Elastic IP address and us-east-1 with your AWS Region. Also, replace eipalloc-source-account with the Elastic IP address AllocationId and transfer-account with the transfer account ID.

To use the AWS CLI to transfer the Elastic IP address, complete the following steps:

  1. To get your Elastic IP address AllocationId, run the following describe-addresses command:

    aws ec2 describe-addresses --filters "Name=public-ip,Values=ELASTIC_IP" --region us-east-1  

    Example output:

    {  
        "Addresses": [  
            {  
                "PublicIp": "ELASTIC_IP",  
                "AllocationId": "eipalloc-source-account",  
                "Domain": "vpc",  
                "PublicIpv4Pool": "amazon",  
                "NetworkBorderGroup": "us-east-1"  
            }  
        ]  
    }
  2. To check whether there are existing or pending address transfers for the Elastic IP address in the source account, run the following describe-address-transfers command:

    aws ec2 describe-address-transfers --query "AddressTransfers[?AllocationId=='eipalloc-source-account']" --region us-east-1  

    If you receive the following output, then there aren't any existing or pending address transfers and you can proceed with the new transfer:

    [ ]
  3. To transfer the Elastic IP address to the transfer account, run the following enable-address-transfer command:

    aws ec2 enable-address-transfer --allocation-id eipalloc-source-account --transfer-account-id transfer-account --region us-east-1      

    Example output:

    "AddressTransfer": {  
            "PublicIp": "3.",  
            "AllocationId": "eipalloc-source-account",  
            "TransferAccountId": "transfer-account",  
            "TransferOfferExpirationTimestamp": "2022-10-28T08:44:41+00:00",  
            "AddressTransferStatus": "pending"  
        }  
    }
  4. Notify the transfer account owner that the Elastic IP address transfer is in the Pending state.

  5. To accept the transfer, the transfer account owner must run the following accept-address-transfer command:

    aws ec2 accept-address-transfer --address ELASTIC_IP --region us-east-1      

    Example output:

    "AddressTransfer": {  
            "PublicIp": "ELASTIC_IP",  
            "AllocationId": "eipalloc-source-account",  
            "TransferAccountId": "transfer-account",  
            "TransferOfferExpirationTimestamp": "2022-10-28T08:44:41+00:00",  
            "AddressTransferStatus": "accepted"  
        }  
    }

    Note: The transfer account can't see Elastic IP addresses that are in the Pending state. This is a security feature in case you accidentally send an IP address to the wrong account. If this occurs, then you can cancel the transfer before the other account sees the IP address.
    If the acceptance fails, then you receive one of the following errors:
    AddressLimitExceeded
    InvalidTransfer.AddressCustomPtrSet
    InvalidTransfer.AddressAssociated
    To troubleshoot the preceding errors, see Accept a transferred Elastic IP address.

  6. To confirm that the Elastic IP address transferred, run the following commands based on the account owner.
    From the transfer account, run the following describe-addresses command:

    aws ec2 describe-addresses --filters "Name=public-ip,Values=ELASTIC_IP" --region us-east-1  

    Example output:

    {  
        "Addresses": [  
            {  
                "PublicIp": "ELASTIC_IP",  
                "AllocationId": "eipalloc-transfer-account22222",  
                "Domain": "vpc",  
                "PublicIpv4Pool": "amazon",  
                "NetworkBorderGroup": "us-east-1"  
            }  
        ]  
    }

    Important: A successful transfer generates a new AllocationId for the Elastic IP address in the transfer owner's account.
    From the source account, run the following describe-address-transfers command:

    aws ec2 describe-address-transfers --query 

    Example output:

    "AddressTransfers[?AllocationId=='eipalloc-source-account']" --region us-east-1  [  
           {  
                "PublicIp": "ELASTIC_IP",  
                "AllocationId": "eipalloc-source-account",  
                "TransferAccountId": "transfer-account",  
                "TransferOfferExpirationTimestamp": "2022-10-28T10:44:41+00:00",  
                "AddressTransferStatus": "accepted"  
            }  
    ]  
3 Comments

What if the two Elastic IPs are both part of CloudFormation Stack?

replied a year ago

Thank you for your comment. We'll review and update the Knowledge Center article as needed.

profile pictureAWS
EXPERT
replied a year ago

The Transfer Elastic IP addresses link points to a page that does not explain anymore how to transfer an Elastic IP address from one AWS account to another one.

The Amazon Virtual Private Cloud (VPC) now supports the transfer of Elastic IP addresses between AWS accounts blog also references the same page.

The correct public documentation page describing the process is now Transfer an Elastic IP address between AWS accounts in the EC2 User Guide

replied 9 months ago