aws ec2 disable-image
Sets the AMI state to disabled and removes all launch permissions from the AMI. AWS CLI reference
1 example 2 options Its page in the AWS CLI reference
Examples
To disable an AMI
The following disable-image example disables the specified AMI.
aws ec2 disable-image --image-id ami-1234567890abcdef0Identify--image-idThe ID of the AMI.Its output
{
"Return": true
}For more information, see Disable an AMI in the Amazon EC2 User Guide.
Options
--dry-runChecks whether you have the required permissions for the action, without actually making the request, and provides an error response.--image-idThe ID of the AMI.