Use ResetInstanceAttribute
with a CLI
The following code examples show how to use ResetInstanceAttribute
.
- CLI
-
- Amazon CLI
-
To reset the sourceDestCheck attribute
This example resets the
sourceDestCheck
attribute of the specified instance. The instance must be in a VPC. If the command succeeds, no output is returned.Command:
aws ec2 reset-instance-attribute --instance-id
i-1234567890abcdef0
--attributesourceDestCheck
To reset the kernel attribute
This example resets the
kernel
attribute of the specified instance. The instance must be in thestopped
state. If the command succeeds, no output is returned.Command:
aws ec2 reset-instance-attribute --instance-id
i-1234567890abcdef0
--attributekernel
To reset the ramdisk attribute
This example resets the
ramdisk
attribute of the specified instance. The instance must be in thestopped
state. If the command succeeds, no output is returned.Command:
aws ec2 reset-instance-attribute --instance-id
i-1234567890abcdef0
--attributeramdisk
-
For API details, see ResetInstanceAttribute
in Amazon CLI Command Reference.
-
- PowerShell
-
- Tools for PowerShell
-
Example 1: This example resets the 'sriovNetSupport' attribute for the specified instance.
Reset-EC2InstanceAttribute -InstanceId i-12345678 -Attribute sriovNetSupport
Example 2: This example resets the 'ebsOptimized' attribute for the specified instance.
Reset-EC2InstanceAttribute -InstanceId i-12345678 -Attribute ebsOptimized
Example 3: This example resets the 'sourceDestCheck' attribute for the specified instance.
Reset-EC2InstanceAttribute -InstanceId i-12345678 -Attribute sourceDestCheck
Example 4: This example resets the 'disableApiTermination' attribute for the specified instance.
Reset-EC2InstanceAttribute -InstanceId i-12345678 -Attribute disableApiTermination
Example 5: This example resets the 'instanceInitiatedShutdownBehavior' attribute for the specified instance.
Reset-EC2InstanceAttribute -InstanceId i-12345678 -Attribute instanceInitiatedShutdownBehavior
-
For API details, see ResetInstanceAttribute
in Amazon Tools for PowerShell Cmdlet Reference.
-
For a complete list of Amazon SDK developer guides and code examples, see Create Amazon EC2 resources using an Amazon SDK. This topic also includes information about getting started and details about previous SDK versions.