AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
Container for the parameters to the ModifyImageAttribute operation. 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.
Namespace: Amazon.EC2.Model
Assembly: AWSSDK.EC2.dll
Version: 3.x.y.z
public class ModifyImageAttributeRequest : AmazonEC2Request IAmazonWebServiceRequest
The ModifyImageAttributeRequest type exposes the following members
Name | Description | |
---|---|---|
![]() |
ModifyImageAttributeRequest() |
Empty constructor used to set properties independently even when a simple constructor is available |
![]() |
ModifyImageAttributeRequest(string, string) |
Instantiates ModifyImageAttributeRequest with the parameterized properties |
Name | Type | Description | |
---|---|---|---|
![]() |
Attribute | System.String |
Gets and sets the property Attribute. The name of the attribute to modify.
Valid values: |
![]() |
Description | System.String |
Gets and sets the property Description. A new description for the AMI. |
![]() |
DryRun | System.Nullable<System.Boolean> |
Gets and sets the property 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 |
![]() |
ImageId | System.String |
Gets and sets the property ImageId. The ID of the AMI. |
![]() |
ImdsSupport | System.String |
Gets and sets the property ImdsSupport.
Set to
Do not use this parameter unless your AMI software supports IMDSv2. After you set
the value to |
![]() |
LaunchPermission | Amazon.EC2.Model.LaunchPermissionModifications |
Gets and sets the property LaunchPermission. A new launch permission for the AMI. |
![]() |
OperationType | Amazon.EC2.OperationType |
Gets and sets the property OperationType.
The operation type. This parameter can be used only when the |
![]() |
OrganizationalUnitArns | System.Collections.Generic.List<System.String> |
Gets and sets the property OrganizationalUnitArns.
The Amazon Resource Name (ARN) of an organizational unit (OU). This parameter can
be used only when the |
![]() |
OrganizationArns | System.Collections.Generic.List<System.String> |
Gets and sets the property OrganizationArns.
The Amazon Resource Name (ARN) of an organization. This parameter can be used only
when the |
![]() |
ProductCodes | System.Collections.Generic.List<System.String> |
Gets and sets the property ProductCodes. Not supported. Starting with version 4 of the SDK this property will default to null. If no data for this property is returned from the service the property will also be null. This was changed to improve performance and allow the SDK and caller to distinguish between a property not set or a property being empty to clear out a value. To retain the previous SDK behavior set the AWSConfigs.InitializeCollections static property to true. |
![]() |
UserGroups | System.Collections.Generic.List<System.String> |
Gets and sets the property UserGroups.
The user groups. This parameter can be used only when the |
![]() |
UserIds | System.Collections.Generic.List<System.String> |
Gets and sets the property UserIds.
The Amazon Web Services account IDs. This parameter can be used only when the |
![]() |
Value | System.String |
Gets and sets the property Value.
The value of the attribute being modified. This parameter can be used only when the
|
This example makes the specified AMI public.
var client = new AmazonEC2Client(); var response = client.ModifyImageAttribute(new ModifyImageAttributeRequest { ImageId = "ami-5731123e", LaunchPermission = new LaunchPermissionModifications { Add = new List<LaunchPermission> { new LaunchPermission { Group = "all" } } } });
This example grants launch permissions for the specified AMI to the specified AWS account.
var client = new AmazonEC2Client(); var response = client.ModifyImageAttribute(new ModifyImageAttributeRequest { ImageId = "ami-5731123e", LaunchPermission = new LaunchPermissionModifications { Add = new List<LaunchPermission> { new LaunchPermission { UserId = "123456789012" } } } });
.NET:
Supported in: 8.0 and newer, Core 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.7.2 and newer