modify_image_attribute¶
Operation¶
modify_image_attribute
async
¶
modify_image_attribute(input: ModifyImageAttributeInput, plugins: list[Plugin] | None = None) -> ModifyImageAttributeOutput
Modifies the specified attribute of the specified AMI. You can specify only one attribute at a time.
To specify the attribute, you can use the Attribute parameter, or one
of the following parameters: Description, ImdsSupport, or
LaunchPermission.
Images with an Amazon Web Services Marketplace product code cannot be made public.
To enable the SriovNetSupport enhanced networking attribute of an image, enable SriovNetSupport on an instance and create an AMI from the instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
ModifyImageAttributeInput
|
An instance of |
required |
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
Returns:
| Type | Description |
|---|---|
ModifyImageAttributeOutput
|
An instance of |
Input¶
ModifyImageAttributeInput
dataclass
¶
Bases: _SerdeShape
Contains the parameters for ModifyImageAttribute.
Attributes¶
attribute
class-attribute
instance-attribute
¶
attribute: str | None = ...
The name of the attribute to modify.
Valid values: description | imdsSupport | launchPermission
description
class-attribute
instance-attribute
¶
A new description for the AMI.
dry_run
class-attribute
instance-attribute
¶
dry_run: bool | None = ...
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.
imds_support
class-attribute
instance-attribute
¶
Set to v2.0 to indicate that IMDSv2 is specified in the AMI. Instances
launched from this AMI will have HttpTokens automatically set to
required so that, by default, the instance requires that IMDSv2 is
used when requesting instance metadata. In addition,
HttpPutResponseHopLimit is set to 2. For more information, see
Configure the
AMI
in the Amazon EC2 User Guide.
Warning
Do not use this parameter unless your AMI software supports IMDSv2.
After you set the value to v2.0, you can't undo it. The only way to
"reset" your AMI is to create a new AMI from the underlying snapshot.
launch_permission
class-attribute
instance-attribute
¶
A new launch permission for the AMI.
operation_type
class-attribute
instance-attribute
¶
operation_type: str | None = ...
The operation type. This parameter can be used only when the Attribute
parameter is launchPermission.
organization_arns
class-attribute
instance-attribute
¶
The Amazon Resource Name (ARN) of an organization. This parameter can be
used only when the Attribute parameter is launchPermission.
organizational_unit_arns
class-attribute
instance-attribute
¶
The Amazon Resource Name (ARN) of an organizational unit (OU). This
parameter can be used only when the Attribute parameter is
launchPermission.
product_codes
class-attribute
instance-attribute
¶
Not supported.
user_groups
class-attribute
instance-attribute
¶
The user groups. This parameter can be used only when the Attribute
parameter is launchPermission.
user_ids
class-attribute
instance-attribute
¶
The Amazon Web Services account IDs. This parameter can be used only
when the Attribute parameter is launchPermission.
Output¶
ModifyImageAttributeOutput
dataclass
¶
Bases: _SerdeShape
Dataclass for ModifyImageAttributeOutput structure.