Overview
Using Organization service in AWS is quite common if you have multi-team/environment architecture. Most of the time we make our deployment environments like staging and production identical so that we can use the exact same sort of configurations for all and it makes DevOps’s life easier. Hence, in this post, we will learn to share the AMI with another account so that we can use the same AMI for our other Organization account as well.
Let’s say you have an AWS account for staging and another for production. You’ve created an AMI for microservice for your staging environment and you want to use the same AMI for your production microservices.
In this case, if you are smart 🙂 Developer or DevOps Engineer you don’t want to create an AMI for production microservices again. Instead, you will try to find a solution to use an existing AMI that you have used for your staging account and will use that AMI for the production account.
Prerequisite
- You must have an account number with whom you want to share your AMI.
Steps to share
- Login to your AWS console
- Make sure you are in the correct Region.
- Search EC2 service and Click on AMI (You can find it on the left side under Images section)
- Select the correct AMI that you want to share with another account.
- On the bottom side click on the Permissions tab.
- Click on the Edit button. A Modify Image Permission popup will be displayed.
- In this popup, the ima
- Add the account number to whom you want to share and click on the Add Permission button.
- To allow create volume permissions for snapshots, select Add “create volume” permissions to the following associated snapshots when creating permissions.
- Click the Save button.
Now, you have successfully shared the AMI to the given account.
Let’s verify whether the AMI is shared with the new account or not.
Steps to verify
- Login to your new account using the AWS console.
- Select EC2 service.
- Go AMI that can be found under Images section.
- The default filter would be Owned by me. Hence, you can’t see the AMI you shared here.
- You need to change it to Private images. The AMI you just shared will be listed here.
Congrats. You are now able to share your AMI with another AWS account.