There are more AWS SDK examples available in the AWS Doc SDK Examples
Use ResetInstanceAttribute with a CLI
The following code examples show how to use ResetInstanceAttribute.
- CLI
-
- AWS CLI
-
To reset the sourceDestCheck attribute
This example resets the
sourceDestCheckattribute 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-idi-1234567890abcdef0--attributesourceDestCheckTo reset the kernel attribute
This example resets the
kernelattribute of the specified instance. The instance must be in thestoppedstate. If the command succeeds, no output is returned.Command:
aws ec2 reset-instance-attribute --instance-idi-1234567890abcdef0--attributekernelTo reset the ramdisk attribute
This example resets the
ramdiskattribute of the specified instance. The instance must be in thestoppedstate. If the command succeeds, no output is returned.Command:
aws ec2 reset-instance-attribute --instance-idi-1234567890abcdef0--attributeramdisk-
For API details, see ResetInstanceAttribute
in AWS CLI Command Reference.
-
- PowerShell
-
- Tools for PowerShell V4
-
Example 1: This example resets the 'sriovNetSupport' attribute for the specified instance.
Reset-EC2InstanceAttribute -InstanceId i-12345678 -Attribute sriovNetSupportExample 2: This example resets the 'ebsOptimized' attribute for the specified instance.
Reset-EC2InstanceAttribute -InstanceId i-12345678 -Attribute ebsOptimizedExample 3: This example resets the 'sourceDestCheck' attribute for the specified instance.
Reset-EC2InstanceAttribute -InstanceId i-12345678 -Attribute sourceDestCheckExample 4: This example resets the 'disableApiTermination' attribute for the specified instance.
Reset-EC2InstanceAttribute -InstanceId i-12345678 -Attribute disableApiTerminationExample 5: This example resets the 'instanceInitiatedShutdownBehavior' attribute for the specified instance.
Reset-EC2InstanceAttribute -InstanceId i-12345678 -Attribute instanceInitiatedShutdownBehavior-
For API details, see ResetInstanceAttribute in AWS Tools for PowerShell Cmdlet Reference (V4).
-
- Tools for PowerShell V5
-
Example 1: This example resets the 'sriovNetSupport' attribute for the specified instance.
Reset-EC2InstanceAttribute -InstanceId i-12345678 -Attribute sriovNetSupportExample 2: This example resets the 'ebsOptimized' attribute for the specified instance.
Reset-EC2InstanceAttribute -InstanceId i-12345678 -Attribute ebsOptimizedExample 3: This example resets the 'sourceDestCheck' attribute for the specified instance.
Reset-EC2InstanceAttribute -InstanceId i-12345678 -Attribute sourceDestCheckExample 4: This example resets the 'disableApiTermination' attribute for the specified instance.
Reset-EC2InstanceAttribute -InstanceId i-12345678 -Attribute disableApiTerminationExample 5: This example resets the 'instanceInitiatedShutdownBehavior' attribute for the specified instance.
Reset-EC2InstanceAttribute -InstanceId i-12345678 -Attribute instanceInitiatedShutdownBehavior-
For API details, see ResetInstanceAttribute in AWS Tools for PowerShell Cmdlet Reference (V5).
-