[ aws . autoscaling ]



Sets the health status of the specified instance.

For more information, see Health Checks for Auto Scaling Instances in the Amazon EC2 Auto Scaling User Guide .

See also: AWS API Documentation

See ‘aws help’ for descriptions of global parameters.


--instance-id <value>
--health-status <value>
[--should-respect-grace-period | --no-should-respect-grace-period]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--cli-auto-prompt <value>]


--instance-id (string)

The ID of the instance.

--health-status (string)

The health status of the instance. Set to Healthy to have the instance remain in service. Set to Unhealthy to have the instance be out of service. Amazon EC2 Auto Scaling terminates and replaces the unhealthy instance.

--should-respect-grace-period | --no-should-respect-grace-period (boolean)

If the Auto Scaling group of the specified instance has a HealthCheckGracePeriod specified for the group, by default, this call respects the grace period. Set this to False , to have the call not respect the grace period associated with the group.

For more information about the health check grace period, see CreateAutoScalingGroup in the Amazon EC2 Auto Scaling API Reference .

--cli-input-json | --cli-input-yaml (string) Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. Similarly, if provided yaml-input it will print a sample input YAML that can be used with --cli-input-yaml. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

--cli-auto-prompt (boolean) Automatically prompt for CLI input parameters.

See ‘aws help’ for descriptions of global parameters.


To set the health status of an instance

This example sets the health status of the specified instance to Unhealthy:

aws autoscaling set-instance-health --instance-id i-93633f9b --health-status Unhealthy