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

NameDescriptionRequired

instance_id

The instance ID.

Type: String

Default: None

Example: i-43a4412a

Yes

--instance-type type

The instance type of the instance.

Type: String

Default: m1.small

Example: m1.large

No

--kernel

Describes the ID of the kernel associated with the AMI.

Type: String

Default: None

Example: --kernel

No

--ramdisk

Describes the ID of the RAM disk associated with the AMI.

Type: String

Default: None

Example: --ramdisk

No

--user-data data

MIME, Base64-encoded user data.

Type: String

Default: None

Example:

No

--disable-api-termination

Specifies 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

--instance-initiated-shutdown-behavior

Specifies whether the instance's Amazon EBS volumes are stopped or terminated when the instance is shut down.

Type: Boolean

Valid Values: stop | terminate

Default: true

Example: --instance-initiated-shutdown-behavior

No

--root-device-name name

The root device name (e.g., /dev/sda1).

Type: String

Default: None

Example: --root-device-name

No

--block-device-mapping

Describes 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