Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
- data ModifyInstanceAttribute = ModifyInstanceAttribute' {
- attribute :: Maybe InstanceAttributeName
- blockDeviceMappings :: Maybe [InstanceBlockDeviceMappingSpecification]
- disableApiStop :: Maybe AttributeBooleanValue
- disableApiTermination :: Maybe AttributeBooleanValue
- dryRun :: Maybe Bool
- ebsOptimized :: Maybe AttributeBooleanValue
- enaSupport :: Maybe AttributeBooleanValue
- groups :: Maybe [Text]
- instanceInitiatedShutdownBehavior :: Maybe AttributeValue
- instanceType :: Maybe AttributeValue
- kernel :: Maybe AttributeValue
- ramdisk :: Maybe AttributeValue
- sourceDestCheck :: Maybe AttributeBooleanValue
- sriovNetSupport :: Maybe AttributeValue
- userData :: Maybe BlobAttributeValue
- value :: Maybe Text
- instanceId :: Text
- newModifyInstanceAttribute :: Text -> ModifyInstanceAttribute
- modifyInstanceAttribute_attribute :: Lens' ModifyInstanceAttribute (Maybe InstanceAttributeName)
- modifyInstanceAttribute_blockDeviceMappings :: Lens' ModifyInstanceAttribute (Maybe [InstanceBlockDeviceMappingSpecification])
- modifyInstanceAttribute_disableApiStop :: Lens' ModifyInstanceAttribute (Maybe AttributeBooleanValue)
- modifyInstanceAttribute_disableApiTermination :: Lens' ModifyInstanceAttribute (Maybe AttributeBooleanValue)
- modifyInstanceAttribute_dryRun :: Lens' ModifyInstanceAttribute (Maybe Bool)
- modifyInstanceAttribute_ebsOptimized :: Lens' ModifyInstanceAttribute (Maybe AttributeBooleanValue)
- modifyInstanceAttribute_enaSupport :: Lens' ModifyInstanceAttribute (Maybe AttributeBooleanValue)
- modifyInstanceAttribute_groups :: Lens' ModifyInstanceAttribute (Maybe [Text])
- modifyInstanceAttribute_instanceInitiatedShutdownBehavior :: Lens' ModifyInstanceAttribute (Maybe AttributeValue)
- modifyInstanceAttribute_instanceType :: Lens' ModifyInstanceAttribute (Maybe AttributeValue)
- modifyInstanceAttribute_kernel :: Lens' ModifyInstanceAttribute (Maybe AttributeValue)
- modifyInstanceAttribute_ramdisk :: Lens' ModifyInstanceAttribute (Maybe AttributeValue)
- modifyInstanceAttribute_sourceDestCheck :: Lens' ModifyInstanceAttribute (Maybe AttributeBooleanValue)
- modifyInstanceAttribute_sriovNetSupport :: Lens' ModifyInstanceAttribute (Maybe AttributeValue)
- modifyInstanceAttribute_userData :: Lens' ModifyInstanceAttribute (Maybe BlobAttributeValue)
- modifyInstanceAttribute_value :: Lens' ModifyInstanceAttribute (Maybe Text)
- modifyInstanceAttribute_instanceId :: Lens' ModifyInstanceAttribute Text
- data ModifyInstanceAttributeResponse = ModifyInstanceAttributeResponse' {
- newModifyInstanceAttributeResponse :: ModifyInstanceAttributeResponse
Creating a Request
data ModifyInstanceAttribute Source #
See: newModifyInstanceAttribute
smart constructor.
ModifyInstanceAttribute' | |
|
Instances
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.
modifyInstanceAttribute_instanceId :: Lens' ModifyInstanceAttribute Text Source #
The ID of the instance.
Destructuring the Response
data ModifyInstanceAttributeResponse Source #
See: newModifyInstanceAttributeResponse
smart constructor.
Instances
newModifyInstanceAttributeResponse :: ModifyInstanceAttributeResponse Source #
Create a value of ModifyInstanceAttributeResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.