To make an AMI public
Add the all group to the AMI's launchPermission
attribute using the ec2-modify-image-attribute
command:
PROMPT>ec2-modify-image-attribute<ami_id>--launch-permission -a all
where <ami_id> is the ID of the AMI.
To check the launch permissions of an AMI
Use the ec2-describe-image-attribute command:
PROMPT>ec2-describe-image-attribute<ami_id>-l
where <ami_id> is the ID of the AMI.
To make an AMI private again
Remove the all group from its launch permissions:
PROMPT>ec2-modify-image-attribute<ami_id>-l -r all
where <ami_id> is the ID of the AMI.
This 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-attributelaunchPermission ami-2bb65342 ADD group allami-2bb65342--launch-permission -a all
This examples displays the launch permissions of the ami-2bb65342 AMI:
PROMPT>ec2-describe-image-attributelaunchPermission ami-2bb65342 group allami-2bb65342-l
This example removes the all group from the permissions of the ami-2bb65342 AMI, making it private:
PROMPT>ec2-modify-image-attributelaunchPermission ami-2bb65342 REMOVE group allami-2bb65342-l -r all