CmdID

CmdID / aws / aws ec2

aws ec2 modify-instance-maintenance-options

Modifies the recovery behavior of your instance to disable simplified automatic recovery or set the recovery behavior to default. AWS CLI reference

2 examples 4 options Its page in the AWS CLI reference

Opens CmdID with your command. It is read in your browser and sent nowhere.

Examples

from aws-cli, each command read by CmdID

Example 1: To disable the recovery behavior of an instance

The following modify-instance-maintenance-options example disables simplified automatic recovery for a running or stopped instance.

aws ec2 modify-instance-maintenance-options --instance-id i-0abcdef1234567890 --auto-recovery disabledIdentify
--instance-idThe ID of the instance.
--auto-recoveryDisables the automatic recovery behavior of your instance or sets it to default.
Its output
{
    "InstanceId": "i-0abcdef1234567890",
    "AutoRecovery": "disabled"
}

For more information, see Configure simplified automatic recovery in the Amazon EC2 User Guide.

Example 2: To set the recovery behavior of an instance to default

The following modify-instance-maintenance-options example sets the automatic recovery behavior to default which enables simplified automatic recovery for supported instance types.

aws ec2 modify-instance-maintenance-options --instance-id i-0abcdef1234567890 --auto-recovery defaultIdentify
--instance-idThe ID of the instance.
--auto-recoveryDisables the automatic recovery behavior of your instance or sets it to default.
Its output
{
    "InstanceId": "i-0abcdef1234567890",
    "AutoRecovery": "default"
}

For more information, see Configure simplified automatic recovery in the Amazon EC2 User Guide.

Options

4 in the AWS CLI reference
--auto-recoveryDisables the automatic recovery behavior of your instance or sets it to default.
--dry-runChecks whether you have the required permissions for the action, without actually making the request, and provides an error response.
--instance-idThe ID of the instance.
--reboot-migrationSpecifies whether to attempt reboot migration during a user-initiated reboot of an instance that has a scheduled system-reboot event: default - Amazon EC2 attempts to migrate the instance to new hardware (reboot migration).