amazonka-ec2-2.0: Amazon Elastic Compute Cloud SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.EC2.ModifyInstanceAttribute

Description

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 in a VPC 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.

Synopsis

Creating a Request

data ModifyInstanceAttribute Source #

See: newModifyInstanceAttribute smart constructor.

Constructors

ModifyInstanceAttribute' 

Fields

  • attribute :: Maybe InstanceAttributeName

    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

  • blockDeviceMappings :: Maybe [InstanceBlockDeviceMappingSpecification]

    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.

    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.

  • disableApiStop :: Maybe AttributeBooleanValue

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

  • disableApiTermination :: Maybe AttributeBooleanValue

    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.

  • dryRun :: Maybe Bool

    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.

  • ebsOptimized :: Maybe AttributeBooleanValue

    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.

  • enaSupport :: Maybe AttributeBooleanValue

    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.

  • groups :: Maybe [Text]
    EC2-VPC
    Replaces the security groups of the instance with the specified security groups. You must specify at least one security group, even if it's just the default security group for the VPC. You must specify the security group ID, not the security group name.
  • instanceInitiatedShutdownBehavior :: Maybe AttributeValue

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

  • instanceType :: Maybe AttributeValue

    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.

  • kernel :: Maybe AttributeValue

    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.

  • ramdisk :: Maybe AttributeValue

    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.

  • sourceDestCheck :: Maybe AttributeBooleanValue

    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.

  • sriovNetSupport :: Maybe AttributeValue

    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.

  • userData :: Maybe BlobAttributeValue

    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.

  • value :: Maybe Text

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

  • instanceId :: Text

    The ID of the instance.

Instances

Instances details
ToHeaders ModifyInstanceAttribute Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstanceAttribute

ToPath ModifyInstanceAttribute Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstanceAttribute

ToQuery ModifyInstanceAttribute Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstanceAttribute

AWSRequest ModifyInstanceAttribute Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstanceAttribute

Generic ModifyInstanceAttribute Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstanceAttribute

Associated Types

type Rep ModifyInstanceAttribute :: Type -> Type #

Read ModifyInstanceAttribute Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstanceAttribute

Show ModifyInstanceAttribute Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstanceAttribute

NFData ModifyInstanceAttribute Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstanceAttribute

Methods

rnf :: ModifyInstanceAttribute -> () #

Eq ModifyInstanceAttribute Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstanceAttribute

Hashable ModifyInstanceAttribute Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstanceAttribute

type AWSResponse ModifyInstanceAttribute Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstanceAttribute

type Rep ModifyInstanceAttribute Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstanceAttribute

type Rep ModifyInstanceAttribute = D1 ('MetaData "ModifyInstanceAttribute" "Amazonka.EC2.ModifyInstanceAttribute" "amazonka-ec2-2.0-48L9RAJvmvzAdBkRegqWCL" 'False) (C1 ('MetaCons "ModifyInstanceAttribute'" 'PrefixI 'True) ((((S1 ('MetaSel ('Just "attribute") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe InstanceAttributeName)) :*: S1 ('MetaSel ('Just "blockDeviceMappings") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [InstanceBlockDeviceMappingSpecification]))) :*: (S1 ('MetaSel ('Just "disableApiStop") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe AttributeBooleanValue)) :*: S1 ('MetaSel ('Just "disableApiTermination") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe AttributeBooleanValue)))) :*: ((S1 ('MetaSel ('Just "dryRun") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "ebsOptimized") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe AttributeBooleanValue))) :*: (S1 ('MetaSel ('Just "enaSupport") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe AttributeBooleanValue)) :*: S1 ('MetaSel ('Just "groups") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Text]))))) :*: (((S1 ('MetaSel ('Just "instanceInitiatedShutdownBehavior") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe AttributeValue)) :*: S1 ('MetaSel ('Just "instanceType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe AttributeValue))) :*: (S1 ('MetaSel ('Just "kernel") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe AttributeValue)) :*: S1 ('MetaSel ('Just "ramdisk") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe AttributeValue)))) :*: ((S1 ('MetaSel ('Just "sourceDestCheck") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe AttributeBooleanValue)) :*: S1 ('MetaSel ('Just "sriovNetSupport") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe AttributeValue))) :*: (S1 ('MetaSel ('Just "userData") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe BlobAttributeValue)) :*: (S1 ('MetaSel ('Just "value") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "instanceId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))))))

newModifyInstanceAttribute Source #

Create a value of ModifyInstanceAttribute with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:attribute:ModifyInstanceAttribute', modifyInstanceAttribute_attribute - 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

ModifyInstanceAttribute, modifyInstanceAttribute_blockDeviceMappings - 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.

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.

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

ModifyInstanceAttribute, modifyInstanceAttribute_disableApiTermination - 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.

$sel:dryRun:ModifyInstanceAttribute', modifyInstanceAttribute_dryRun - 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.

ModifyInstanceAttribute, modifyInstanceAttribute_ebsOptimized - 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.

ModifyInstanceAttribute, modifyInstanceAttribute_enaSupport - 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.

ModifyInstanceAttribute, modifyInstanceAttribute_groups - [EC2-VPC] Replaces the security groups of the instance with the specified security groups. You must specify at least one security group, even if it's just the default security group for the VPC. You must specify the security group ID, not the security group name.

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

ModifyInstanceAttribute, modifyInstanceAttribute_instanceType - 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.

$sel:kernel:ModifyInstanceAttribute', modifyInstanceAttribute_kernel - 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.

$sel:ramdisk:ModifyInstanceAttribute', modifyInstanceAttribute_ramdisk - 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.

ModifyInstanceAttribute, modifyInstanceAttribute_sourceDestCheck - 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.

ModifyInstanceAttribute, modifyInstanceAttribute_sriovNetSupport - 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.

ModifyInstanceAttribute, modifyInstanceAttribute_userData - 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.

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

ModifyInstanceAttribute, modifyInstanceAttribute_instanceId - The ID of the instance.

Request Lenses

modifyInstanceAttribute_attribute :: Lens' ModifyInstanceAttribute (Maybe InstanceAttributeName) Source #

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

modifyInstanceAttribute_blockDeviceMappings :: Lens' ModifyInstanceAttribute (Maybe [InstanceBlockDeviceMappingSpecification]) Source #

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.

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.

modifyInstanceAttribute_disableApiStop :: Lens' ModifyInstanceAttribute (Maybe AttributeBooleanValue) Source #

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

modifyInstanceAttribute_disableApiTermination :: Lens' ModifyInstanceAttribute (Maybe AttributeBooleanValue) Source #

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.

modifyInstanceAttribute_dryRun :: Lens' ModifyInstanceAttribute (Maybe Bool) Source #

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.

modifyInstanceAttribute_ebsOptimized :: Lens' ModifyInstanceAttribute (Maybe AttributeBooleanValue) Source #

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.

modifyInstanceAttribute_enaSupport :: Lens' ModifyInstanceAttribute (Maybe AttributeBooleanValue) Source #

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.

modifyInstanceAttribute_groups :: Lens' ModifyInstanceAttribute (Maybe [Text]) Source #

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

modifyInstanceAttribute_instanceInitiatedShutdownBehavior :: Lens' ModifyInstanceAttribute (Maybe AttributeValue) Source #

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

modifyInstanceAttribute_instanceType :: Lens' ModifyInstanceAttribute (Maybe AttributeValue) Source #

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.

modifyInstanceAttribute_kernel :: Lens' ModifyInstanceAttribute (Maybe AttributeValue) Source #

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.

modifyInstanceAttribute_ramdisk :: Lens' ModifyInstanceAttribute (Maybe AttributeValue) Source #

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.

modifyInstanceAttribute_sourceDestCheck :: Lens' ModifyInstanceAttribute (Maybe AttributeBooleanValue) Source #

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.

modifyInstanceAttribute_sriovNetSupport :: Lens' ModifyInstanceAttribute (Maybe AttributeValue) Source #

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.

modifyInstanceAttribute_userData :: Lens' ModifyInstanceAttribute (Maybe BlobAttributeValue) Source #

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.

modifyInstanceAttribute_value :: Lens' ModifyInstanceAttribute (Maybe Text) Source #

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

Destructuring the Response

data ModifyInstanceAttributeResponse Source #

See: newModifyInstanceAttributeResponse smart constructor.

Instances

Instances details
Generic ModifyInstanceAttributeResponse Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstanceAttribute

Associated Types

type Rep ModifyInstanceAttributeResponse :: Type -> Type #

Read ModifyInstanceAttributeResponse Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstanceAttribute

Show ModifyInstanceAttributeResponse Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstanceAttribute

NFData ModifyInstanceAttributeResponse Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstanceAttribute

Eq ModifyInstanceAttributeResponse Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstanceAttribute

type Rep ModifyInstanceAttributeResponse Source # 
Instance details

Defined in Amazonka.EC2.ModifyInstanceAttribute

type Rep ModifyInstanceAttributeResponse = D1 ('MetaData "ModifyInstanceAttributeResponse" "Amazonka.EC2.ModifyInstanceAttribute" "amazonka-ec2-2.0-48L9RAJvmvzAdBkRegqWCL" 'False) (C1 ('MetaCons "ModifyInstanceAttributeResponse'" 'PrefixI 'False) (U1 :: Type -> Type))

newModifyInstanceAttributeResponse :: ModifyInstanceAttributeResponse Source #

Create a value of ModifyInstanceAttributeResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.