Amazon Elastic Compute Cloud
API Reference (API Version 2011-12-15)
Print this pageEmail this pageGo to the ForumsView the PDFShare this page on TwitterShare this page on FacebookBookmark this page on DeliciousSubmit this page to RedditSubmit this page to DiggDid this page help you?  Yes  No   Tell us about it...

ModifyInstanceAttribute

Description

Modifies an attribute of an instance.

[Note]Note
To modify some attributes, the instance must be stopped. For more information, see Using Instance Metadata in the Amazon Elastic Compute Cloud User's Guide.

[Note]Note

If you want to add ephemeral storage to an Amazon EBS-backed instance, you must add the ephemeral storage at the time you launch the instance. For more information, go to Overriding the AMI's Block Device Mapping in the Amazon Elastic Compute Cloud User Guide, or to Using Amazon EC2 Instance Storage in the Amazon Elastic Compute Cloud User Guide.

Request Parameters

NameDescriptionRequired

InstanceId

The ID of the instance.

Type: String

Default: None

Yes

InstanceType.Value

Changes the instance type to the specified value.

Type: String

Default: None

No

Kernel.Value

Changes the instance's kernel to the specified value.

Type: String

Default: None

No

Ramdisk.Value

Changes the instance's RAM disk to the specified value.

Type: String

Default: None

No

UserData.Value

Changes the instance's user data to the specified value.

Type: String

Default: None

No

DisableApiTermination.Value

Changes the instance's DisableApiTermination flag to the specified value. A value of true means you can't terminate the instance using the API (i.e., the instance is "locked"); a value of false means you can. You must modify this attribute before you can terminate any "locked" instances using the API.

Type: Boolean

Default: None

No

InstanceInitiatedShutdownBehavior.Value

Changes the instance's InstanceInitiatedShutdownBehavior flag to the specified value.

Type: String

Default: None

Valid Values: stop | terminate

No

BlockMappingDevice.Value

Modifies the DeleteOnTermination atttribute for volumes that are currently attached. The volume must be owned by the caller. If no value is specified for DeleteOnTerminaton, the value defaults to true and the volume will be deleted when the instance is terminated.

Type: BlockDeviceMapping

Default: None

Example:

&BlockDeviceMapping1.DeviceName=/dev/sdh
&BlockDeviceMapping.1.Ebs.DeleteOnTermination=true
|

No

SourceDestCheck.Value

This attribute exists to enable a Network Address Translation (NAT) instance in a VPC to perform NAT. The attribute controls whether source/destination checking is enabled on the instance. A value of true means checking is enabled, and false means checking is disabled. The value must be false for the instance to perform NAT. For more information, go to NAT Instances in the Amazon Virtual Private Cloud User Guide.

Type: Boolean

Default: None

No

GroupId.n

This attribute is applicable only to instances running in a VPC. Use this parameter when you want to change the security groups that an instance is in. The new set of groups you specify replaces the current set. You must specify at least one group, even if it's just the default security group in the VPC. You must specify the group ID and not the group name.

For example, if you want the instance to be in sg-1a1a1a1a and sg-9b9b9b9b, specify GroupId.1=sg-1a1a1a1a and GroupId.2=sg-9b9b9b9b.

Type: String

Default: None

No

Response Elements

The elements in the following table are wrapped in a ModifyInstanceAttributeResponse structure.

NameDescription

requestId

The ID of the request.

Type: xsd:string

return

Returns true if successful. Otherwise, returns an error.

Type: xsd:boolean

Examples

Example Request

This example changes the kernel for the instance.

https://ec2.amazonaws.com/?Action=ModifyInstanceAttribute
&InstanceId=i-10a64379
&Kernel.Value=aki-f70657b2
&AUTHPARAMS

Example Response

<ModifyInstanceAttributeResponse xmlns="http://ec2.amazonaws.com/doc/2011-12-15/">
  <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> 
  <return>true</return>
</ModifyInstanceAttributeResponse>