Skip to content

/AWS1/CL_EC2=>MODIFYINSTANCEATTRIBUTE()

About ModifyInstanceAttribute

Modifies the specified attribute of the specified instance. You can specify only one attribute at a time.

Note: Using this action to change the security groups associated with an elastic network interface (ENI) attached to an instance can result in an error if the instance has more than one ENI. To change the security groups associated with an ENI attached to an instance that has multiple ENIs, we recommend that you use the ModifyNetworkInterfaceAttribute action.

To modify some attributes, the instance must be stopped. For more information, see Modify a stopped instance in the Amazon EC2 User Guide.

Method Signature

IMPORTING

Required arguments:

IV_INSTANCEID TYPE /AWS1/EC2INSTANCEID /AWS1/EC2INSTANCEID

The ID of the instance.

Optional arguments:

IO_SOURCEDESTCHECK TYPE REF TO /AWS1/CL_EC2ATTRBOOLEANVALUE /AWS1/CL_EC2ATTRBOOLEANVALUE

Enable or disable source/destination checks, which ensure that the instance is either the source or the destination of any traffic that it receives. If the value is true, source/destination checks are enabled; otherwise, they are disabled. The default value is true. You must disable source/destination checks if the instance runs services such as network address translation, routing, or firewalls.

IV_ATTRIBUTE TYPE /AWS1/EC2INSTANCEATTRIBUTENAME /AWS1/EC2INSTANCEATTRIBUTENAME

The name of the attribute to modify.

You can modify the following attributes only: disableApiTermination | instanceType | kernel | ramdisk | instanceInitiatedShutdownBehavior | blockDeviceMapping | userData | sourceDestCheck | groupSet | ebsOptimized | sriovNetSupport | enaSupport | nvmeSupport | disableApiStop | enclaveOptions

IT_BLOCKDEVICEMAPPINGS TYPE /AWS1/CL_EC2INSTBLKDEVMAPSPEC=>TT_INSTBLOCKDEVICEMAPSPECLIST TT_INSTBLOCKDEVICEMAPSPECLIST

Modifies the DeleteOnTermination attribute for volumes that are currently attached. The volume must be owned by the caller. If no value is specified for DeleteOnTermination, the default is true and the volume is deleted when the instance is terminated. You can't modify the DeleteOnTermination attribute for volumes that are attached to Fargate tasks.

To add instance store volumes to an Amazon EBS-backed instance, you must add them when you launch the instance. For more information, see Update the block device mapping when launching an instance in the Amazon EC2 User Guide.

IO_DISABLEAPITERMINATION TYPE REF TO /AWS1/CL_EC2ATTRBOOLEANVALUE /AWS1/CL_EC2ATTRBOOLEANVALUE

If the value is true, you can't terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can. You cannot use this parameter for Spot Instances.

IV_DRYRUN TYPE /AWS1/EC2BOOLEAN /AWS1/EC2BOOLEAN

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

IO_EBSOPTIMIZED TYPE REF TO /AWS1/CL_EC2ATTRBOOLEANVALUE /AWS1/CL_EC2ATTRBOOLEANVALUE

Specifies whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.

IO_ENASUPPORT TYPE REF TO /AWS1/CL_EC2ATTRBOOLEANVALUE /AWS1/CL_EC2ATTRBOOLEANVALUE

Set to true to enable enhanced networking with ENA for the instance.

This option is supported only for HVM instances. Specifying this option with a PV instance can make it unreachable.

IT_GROUPS TYPE /AWS1/CL_EC2GROUPIDSTRLIST_W=>TT_GROUPIDSTRINGLIST TT_GROUPIDSTRINGLIST

Replaces the security groups of the instance with the specified security groups. You must specify the ID of at least one security group, even if it's just the default security group for the VPC.

IO_INSTINITIATEDSHUTDOWNBE00 TYPE REF TO /AWS1/CL_EC2ATTRIBUTEVALUE /AWS1/CL_EC2ATTRIBUTEVALUE

Specifies whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

IO_INSTANCETYPE TYPE REF TO /AWS1/CL_EC2ATTRIBUTEVALUE /AWS1/CL_EC2ATTRIBUTEVALUE

Changes the instance type to the specified value. For more information, see Instance types in the Amazon EC2 User Guide. If the instance type is not valid, the error returned is InvalidInstanceAttributeValue.

IO_KERNEL TYPE REF TO /AWS1/CL_EC2ATTRIBUTEVALUE /AWS1/CL_EC2ATTRIBUTEVALUE

Changes the instance's kernel to the specified value. We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB.

IO_RAMDISK TYPE REF TO /AWS1/CL_EC2ATTRIBUTEVALUE /AWS1/CL_EC2ATTRIBUTEVALUE

Changes the instance's RAM disk to the specified value. We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB.

IO_SRIOVNETSUPPORT TYPE REF TO /AWS1/CL_EC2ATTRIBUTEVALUE /AWS1/CL_EC2ATTRIBUTEVALUE

Set to simple to enable enhanced networking with the Intel 82599 Virtual Function interface for the instance.

There is no way to disable enhanced networking with the Intel 82599 Virtual Function interface at this time.

This option is supported only for HVM instances. Specifying this option with a PV instance can make it unreachable.

IO_USERDATA TYPE REF TO /AWS1/CL_EC2BLOBATTRIBUTEVALUE /AWS1/CL_EC2BLOBATTRIBUTEVALUE

Changes the instance's user data to the specified value. If you are using an Amazon Web Services SDK or command line tool, base64-encoding is performed for you, and you can load the text from a file. Otherwise, you must provide base64-encoded text.

IV_VALUE TYPE /AWS1/EC2STRING /AWS1/EC2STRING

A new value for the attribute. Use only with the kernel, ramdisk, userData, disableApiTermination, or instanceInitiatedShutdownBehavior attribute.

IO_DISABLEAPISTOP TYPE REF TO /AWS1/CL_EC2ATTRBOOLEANVALUE /AWS1/CL_EC2ATTRBOOLEANVALUE

Indicates whether an instance is enabled for stop protection. For more information, see Stop Protection.