How-to Copy an AMI from One AWS Region to Another

How-to Copy an AMI from One AWS Region to Another

Copy AWS AMI from One Region to AnotherAWS is ideally suited for making the user’s applications tolerant to disaster. One of the options for making the user’s application suitable to DR is to keep a back up of the data / application setup in multiple regions. If the first region is not reachable due to some reason, the user can start the application from the other region. In Dec 2021 AWS introduced the functionality to copy snapshot across regions. In March 2022 AWS announced the functionality to migrate the AMI from one region to another. The present guide demonstrates how to copy an AMI from one region to other.

Copying the AMI from one region enabled the easier multi region deployment for the user. The application can be made highly available by setting a failover to another region. AMI copy also adds scalability to the application as the user can scale applications across the globe.

A few important aspects of AMI copy are:

  • The permission and tags are not copied from one region to another. The user has to explicitly set it after copy.
  • The user can copy the AMI to any region. For each region the AMI ID will be different.
  • The user can copy only AMIs owned by the user. The AWS marketplace or community AMIs cannot be copied.
  • There is no linkage between the source and destination AMI once copied. The user can modify any AMI as per need and the changes will not be reflected to other AMI.
  • If the user is using AKI or ARI other than those recommended by AWS, the AMI may not be copied since AWS tries to find a matching AKI or AMI in the target region.
  • The copy functionality is free; only the data transfer rate will be applied as per the AWS standard.
  • The user can copy any type of AMI (EBS backed or Instance backed AMI) with this option.
  • When the AMI is created in the target region, there will be a snapshot created for this AMI. Generally for new EBS backed AMIs snapshots the description is “Created by CreateImage(<AMI ID>) for <original AMI ID> from <EBS Volume ID> “.The snapshot created by the copied AMI will not have a similar description.

1. Go to the AWS Console and select the EC2 Service. Go to the AMI section.

2. Select the AMI. Either right click and select the copy option or click the “copy” button from top.

3. Enter the Target Region where the AMI will be copied, the name and description of the AMI. Click “Yes, Copy” to start the copy process.

4. AWS will start copying the AMI to the target region. (In this case it is the Tokyo Region) It will show the acknowledgement with the new AMI ID in the Tokyo region.

5. Change the region of the AMI screen to Tokyo. It will show that the AMI copy is in progress.

6. Once the image is copied the status will change to Available.

7. As shown above, the AMI has been copied from the US West region to the Tokyo region with ease.

8. If the user wants to copy the AMI with the command line option, first set the EC2 command line tool. If you have setup the command line tool before March 2022, it is recommended to download new the API tool and do the setup.

9. Run the following command:

ec2-copy-image -r <Source Region> -s <Source AMI ID> -n "<Name of AMI>" -d "Description" --region <Target Region>

The above mentioned command should be executed from the target region unlike the console UI where it is executed from the source region. If the user does not want to set the target region, specify it with the -region parameter in command.

10. As shown above, verify whether the AMI has been created in the target region with the following command:

Ec2-describe-images --region <Target Region>

11. The above mentioned steps complete the process of copying the image from one region to another.

Keywords: Amazon web services, Amazon AWS console, Amazon AWS instances, EC2 Service, Amazon cloud computing, EBS, AMI, Disaster Recovery, Cloud Backup, AWS Region, Cloud Availability, Disaster Recovery

You must be to post a comment.

* As a bonus, you'll receive our weekly newsletter!

Hitchhiker's Guide to The Cloud

Newvem's eBook for Cloud Operations