[ aws . autoscaling ]

set-instance-health

Description

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.

Synopsis

  set-instance-health
--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>]

Options

--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.

See ‘aws help’ for descriptions of global parameters.

Examples

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

Output

None