ModifyInstanceAttribute#

Description#

Modifies the specified attribute of the specified instance.

Request Parameters#

Required parameters#

  • instanceId — The ID of the instance.

    • Type: String

    • Required: Yes

Optional parameters#

  • DisableApiTermination.Value — If the value is true, you can’t terminate the instance using the API.

    • Type: Boolean

    • Required: No

  • GroupSetNot supported

  • InstanceInitiatedShutdownBehavior.Value — This action defines whether the instance will be stopped or terminated when you run the OS shutdown command.

    • Type: String

    • Valid values: stop | terminate

    • Required: No

  • InstanceType.Value — The instance type.

  • HighAvailable.Value — The high availability mode.

    • Type: Boolean

    • Required: No

  • KeyName.Value — The name of SSH key pair.

    • Type: String

    • Required: No

  • KernelNot supported

  • RamdiskNot supported

  • RootDeviceName.Value — The name of the root (boot) device or ID of the attached volume to be used as the new boot volume.

    • Type: String

    • Valid values: disk1 | cdrom1 | menu | vol-XXXXXXXX

    • Default value: disk1

    • Required: No

  • SourceDestCheck — Indicates whether source/destination checking is enabled. True means checking is enabled, and False means checking is disabled. This value must be false for a NAT instance to perform NAT.

  • UserData.Value — The instance’s user data. Data that is passed in this parameter must be base64-encoded and must not exceed 16 KB.

    • Type: String

    • Required: No

  • VirtualizationType.Value — The virtualization type (legacy OS support).

    • Type: String

    • Possible values: hvm | hvm-legacy

    • Required: No

Response Elements#

  • returnTrue is returned if the request succeeds and an error otherwise.

    • Type: Boolean

  • requestId — The request ID

    • Type: String

Examples#

c2-ec2 ModifyInstanceAttribute InstanceId i-01234567 InstanceType.Value <instance_type>