| Did this page help you? Yes No Tell us about it... |
Modifies an attribute of an instance.
![]() | 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 Adding A Default Instance Store in the Amazon Elastic Compute Cloud User Guide. |
The short version of this command is ec2minatt.
ec2-modify-instance-attribute
instance_id {--instance-type type | --kernel
kernel_id | --ramdisk ramdisk_id | --user-data
user_data | --disable-api-termination Boolean |
--instance-initiated-shutdown-behavior behavior | --block-device-mapping mapping |
--source-dest-check Boolean | --group-id group_id [...] }
| Name | Description | Required |
|---|---|---|
|
|
The instance ID. Type: String Default: None Example: i-43a4412a |
Yes |
|
|
The type of the instance. Type: String Default: m1.small Example: -t m1.large |
No |
|
|
Sets the ID of the kernel associated with the AMI. Type: String Default: None Example: --kernel aki-1a2b3c4d |
No |
|
|
Sets the ID of the RAM disk associated with the AMI. Type: String Default: None Example: --ramdisk ari-1a2b3c4d |
No |
|
|
Specifies Base64-encoded MIME user data to be made available to the instance(s) in this reservation. Type: String Default: None Example: --user-data "My user data" |
No |
|
|
Specifies whether the instance can be terminated using the EC2 API. A value of Type: Boolean Default: None Example: --disable-api-termination false |
No |
|
|
If an instance shutdown is initiated, this determines whether the instance stops or terminates. Type: String Valid Values: Default: Example: --instance-initiated-shutdown-behavior stop |
No |
|
|
Modifies the Type: BlockDeviceMapping Default: Example: --b "/dev/sdb=vol-7eb96d16:false |
No |
|
|
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 Type: Boolean Default: None Example: --source-dest-check false |
No |
|
|
This is applicable only to instances running in a VPC. Use this parameter when you want to change the security groups 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 Type: String Default: None Example: -g sg-1a1a1a1a |
No |
| Option | Description |
|---|---|
|
|
Overrides the Region specified in the Default: The Example: |
|
|
Default: The Example: |
|
|
The private key to use when constructing requests to Amazon EC2. Default: The value of the Example: |
|
|
The X.509 certificate to use when constructing requests to Amazon EC2. Default: The value of the Example: |
|
|
Specifies a connection timeout (in seconds). Example: --connection-timeout 30 |
|
|
Specifies a request timeout (in seconds). Example: --request-timeout 45 |
|
|
Displays verbose output by showing the SOAP request and response on the command line. This is particularly useful if you are building tools to talk directly to our SOAP API. |
|
|
Displays column headers in the output. |
|
|
Shows empty columns as |
|
|
Do not display tags for tagged resources. |
|
|
Prints internal debugging information. This is useful to assist us when troubleshooting problems. |
|
|
Displays Help. |
|
|
If Example: |
The command returns a table that contains the following information:
Attribute type identifier
ID of the instance on which attributes are being modified
Amazon EC2 command line tools display errors on stderr.
This example changes the kernel for the instance.
PROMPT>ec2-modify-instance-attribute i-10a64379 --kernel aki-f70657b2KERNEL i-10a64379 aki-f70657b2