Sharing an AMI with Specific Users

You can share an AMI with specific users without making the AMI public. All you need is the user's AWS user's account ID, which is available on the AWS Account Activity page.

To grant explicit launch permissions

To remove launch permissions for a user

To remove all launch permissions

[Note]Note

The AMI owner always has rights to the AMI and will be unaffected by the ec2-reset-image-attribute command.

Example

The following example grants launch permissions to the 495219933132 user for the ami-2bb65342 AMI:

PROMPT> ec2-modify-image-attribute ami-2bb65342 -l -a 495219933132
launchPermission        ami-2bb65342    ADD     userId  495219933132

The following example removes launch permissions from the 495219933132 user for the ami-2bb65342 AMI:

PROMPT> ec2-modify-image-attribute ami-2bb65342 -l -r 495219933132
launchPermission        ami-2bb65342    REMOVE  userId  495219933132

The following example removes all public and explicit launch permissions from the ami-2bb65342 AMI:

PROMPT> ec2-reset-image-attribute ami-2bb65342 -l
launchPermission        ami-2bb65342    RESET