EC2 / Client / reset_image_attribute

reset_image_attribute#

EC2.Client.reset_image_attribute(**kwargs)#

Resets an attribute of an AMI to its default value.

See also: AWS API Documentation

Request Syntax

response = client.reset_image_attribute(
    Attribute='launchPermission',
    ImageId='string',
    DryRun=True|False
)
Parameters:
  • Attribute (string) –

    [REQUIRED]

    The attribute to reset (currently you can only reset the launch permission attribute).

  • ImageId (string) –

    [REQUIRED]

    The ID of the AMI.

  • DryRun (boolean) – Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

None

Examples

This example resets the launchPermission attribute for the specified AMI. By default, AMIs are private.

response = client.reset_image_attribute(
    Attribute='launchPermission',
    ImageId='ami-5731123e',
)

print(response)

Expected Output:

{
    'ResponseMetadata': {
        '...': '...',
    },
}