Learn R Programming

paws.compute (version 0.1.12)

ec2_modify_image_attribute: 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. You can use the Attribute parameter to specify the attribute or one of the following parameters: Description, LaunchPermission, or ProductCode.

AWS Marketplace product codes cannot be modified. Images with an AWS 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)

Value

An empty list.

Arguments

Attribute

The name of the attribute to modify. The valid values are description, launchPermission, and productCodes.

Description

A new description for the AMI.

ImageId

[required] The ID of the AMI.

LaunchPermission

A new launch permission for the AMI.

OperationType

The operation type. This parameter can be used only when the Attribute parameter is launchPermission.

ProductCodes

The DevPay product codes. After you add a product code to an AMI, it can't be removed.

UserGroups

The user groups. This parameter can be used only when the Attribute parameter is launchPermission.

UserIds

The AWS account IDs. This parameter can be used only when the Attribute parameter is launchPermission.

Value

The value of the attribute being modified. This parameter can be used only when the Attribute parameter is description or productCodes.

DryRun

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.

Request syntax

svc$modify_image_attribute(
  Attribute = "string",
  Description = list(
    Value = "string"
  ),
  ImageId = "string",
  LaunchPermission = list(
    Add = list(
      list(
        Group = "all",
        UserId = "string"
      )
    ),
    Remove = list(
      list(
        Group = "all",
        UserId = "string"
      )
    )
  ),
  OperationType = "add"|"remove",
  ProductCodes = list(
    "string"
  ),
  UserGroups = list(
    "string"
  ),
  UserIds = list(
    "string"
  ),
  Value = "string",
  DryRun = TRUE|FALSE
)

Examples

Run this code
if (FALSE) {
# 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"
      )
    )
  )
)
}

Run the code above in your browser using DataLab