Modify Image Attribute
| ec2_modify_image_attribute | R Documentation |
Modifies the specified attribute of the specified AMI¶
Description¶
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.
Usage¶
ec2_modify_image_attribute(Attribute, Description, ImageId,
LaunchPermission, OperationType, ProductCodes, UserGroups, UserIds,
Value, DryRun, OrganizationArns, OrganizationalUnitArns, ImdsSupport)
Arguments¶
AttributeThe name of the attribute to modify.
Valid values:
description|imdsSupport|launchPermissionDescriptionA new description for the AMI.
ImageId[required] The ID of the AMI.
LaunchPermissionA new launch permission for the AMI.
OperationTypeThe operation type. This parameter can be used only when the
Attributeparameter islaunchPermission.ProductCodesNot supported.
UserGroupsThe user groups. This parameter can be used only when the
Attributeparameter islaunchPermission.UserIdsThe Amazon Web Services account IDs. This parameter can be used only when the
Attributeparameter islaunchPermission.ValueThe value of the attribute being modified. This parameter can be used only when the
Attributeparameter isdescriptionorimdsSupport.DryRunChecks 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 isUnauthorizedOperation.OrganizationArnsThe Amazon Resource Name (ARN) of an organization. This parameter can be used only when the
Attributeparameter islaunchPermission.OrganizationalUnitArnsThe Amazon Resource Name (ARN) of an organizational unit (OU). This parameter can be used only when the
Attributeparameter islaunchPermission.ImdsSupportSet to
v2.0to indicate that IMDSv2 is specified in the AMI. Instances launched from this AMI will haveHttpTokensautomatically set torequiredso that, by default, the instance requires that IMDSv2 is used when requesting instance metadata. In addition,HttpPutResponseHopLimitis set to2. For more information, see Configure the AMI in the Amazon EC2 User Guide.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.
Value¶
An empty list.
Request syntax¶
svc$modify_image_attribute(
Attribute = "string",
Description = list(
Value = "string"
),
ImageId = "string",
LaunchPermission = list(
Add = list(
list(
Group = "all",
UserId = "string",
OrganizationArn = "string",
OrganizationalUnitArn = "string"
)
),
Remove = list(
list(
Group = "all",
UserId = "string",
OrganizationArn = "string",
OrganizationalUnitArn = "string"
)
)
),
OperationType = "add"|"remove",
ProductCodes = list(
"string"
),
UserGroups = list(
"string"
),
UserIds = list(
"string"
),
Value = "string",
DryRun = TRUE|FALSE,
OrganizationArns = list(
"string"
),
OrganizationalUnitArns = list(
"string"
),
ImdsSupport = list(
Value = "string"
)
)
Examples¶
## Not run:
# This example makes the specified AMI public.
svc$modify_image_attribute(
ImageId = "ami-5731123e",
LaunchPermission = list(
Add = list(
list(
Group = "all"
)
)
)
)
# This example grants launch permissions for the specified AMI to the
# specified AWS account.
svc$modify_image_attribute(
ImageId = "ami-5731123e",
LaunchPermission = list(
Add = list(
list(
UserId = "123456789012"
)
)
)
)
## End(Not run)