Making an AMI Public
To make an AMI public
-
Add the
allgroup to the AMI'slaunchPermissionattribute using the ec2-modify-image-attribute command, where<ami_id>is the ID of the AMI.PROMPT>ec2-modify-image-attribute<ami_id>--launch-permission -a all
To check the launch permissions of an AMI
-
Enter the ec2-describe-image-attribute command, where
<ami_id>is the ID of the AMI.PROMPT>ec2-describe-image-attribute<ami_id>-l
To make an AMI private again
-
Remove the
allgroup from its launch permissions, where<ami_id>is the ID of the AMI.PROMPT>ec2-modify-image-attribute<ami_id>-l -r allThis will not affect any explicit launch permissions for the AMI or any running instances of the AMI.
Example
This example makes the ami-2bb65342 AMI public.
PROMPT>ec2-modify-image-attributeami-2bb65342--launch-permission -a all launchPermission ami-2bb65342 ADD group all
This examples displays the launch permissions of the ami-2bb65342 AMI.
PROMPT>ec2-describe-image-attributeami-2bb65342-l launchPermission ami-2bb65342 group all
This example removes the all group from the permissions of the ami-2bb65342 AMI, making it private.
PROMPT>ec2-modify-image-attributeami-2bb65342-l -r all launchPermission ami-2bb65342 REMOVE group all