ec2-modify-instance-attribute
Description
Modifies an attribute of an instance.
Syntax
ec2-modify-instance-attribute
instance_id
id { --block-device-mapping mapping
| --disable-api-termination | --instance-initiated-shutdown-behavior behavior
| --instance-type type
| --kernel kernel_id
| --ramdisk ramdisk_id
| --user-data data
}
Options
Name | Description | Required |
---|---|---|
|
The instance ID. Type: String Default: None Example: i-43a4412a |
Yes |
|
Modifies the ID of the kernel associated with the AMI. Type: String Default: None Example: --kernel |
No |
|
Modifies the ID of the RAM disk associated with the AMI. Type: String Default: None Example: --ramdisk |
No |
|
MIME, Base64-encoded user data. Type: String Default: None Example: |
No |
|
Modifies whether the instance can be terminated using the APIs. You must modify this attribute before you can terminate any "locked" instances from the APIs. Type: Boolean Default: true Example: --disable-api-termination |
No |
|
Specifies whether the instance's Amazon EBS volumes are stopped or terminated when the instance is shut down. Type: Boolean Valid Values: Default: true Example: --instance-initiated-shutdown-behavior |
No |
|
Modifies the mapping that defines native device names to use when exposing virtual devices. Type: String Default: None Example: -block-device-mapping |
No |
Output
The command returns a table that contains the following information:
-
Attribute type identifier
-
ID of the instance on which attributes are being modified
-
Action performed on the attribute
-
Attribute or attribute list item value type
-
Attribute or attribute list item value
Amazon EC2 displays errors on stderr.
Examples
Example Request
This example changed the kernel for the instance.
PROMPT>ec2-modify-instance-attribute i-10a64379 --kernel aki-f70657b2
KERNEL i-10a64379 aki-f70657b2