Moving an EC2 Instance Store AMI from one region to another is fairly straightforward and much easier than an EBS backed AMI.
To do this, we will need the following:
- AWS Access Key ID
- AWS Secret Key
- An S3 Client
- The kernel image to use in the new region
To install ec2-ami-tools, see our article: HowTo: Install AWS CLI – Amazon Elastic Compute Cloud (EC2) – AMI Tools. To find which kernel image to use in the new region, see our article HowTo: Amazon EC2 Kernel Images – PV Grub.
First we need to create a bucket in region we want to migrate to. In this article we’ll migrate to us-west-2. This can be done with s3curl like so
1 2 3 4
Or this can be done in the S3 Management Console:
- Click “Create Bucket” on the top of the left hand column
- Choose your bucket name
- Select “Oregon” from the Region dropdown
Now that we have bucket, we can migrate the image. We’ll set
--owner-akid to your AWS Access Key ID and
--owner-sak to your AWS Secret Key. The migration tool is picky about the destination bucket, you can only put it in the root level, however we can add a key prefix (move it to a subdirectory) after the migration.
1 2 3 4 5 6 7 8 9
Once the migration is done, we can move it to a new “directory”, the easiest way is to use the S3 Management Console to create a new directory and drag and drop the image files into said new directory.
Finally we register new image
1 2 3 4
And now we’re ready to run our AMI in the new region.