CmdID

CmdID / aws / aws autoscaling

aws autoscaling start-instance-refresh

Starts an instance refresh. 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 start an instance refresh using command line parameters

The following start-instance-refresh example starts an instance refresh using command line arguments. The optional preferences parameter specifies an InstanceWarmup of 60 seconds and a MinHealthyPercentage of 50 percent.

aws autoscaling start-instance-refresh --auto-scaling-group-name my-asg --preferences '{"InstanceWarmup": 60, "MinHealthyPercentage": 50}'Identify
--auto-scaling-group-nameThe name of the Auto Scaling group.
--preferencesSets your preferences for the instance refresh so that it performs as expected when you start it.
Its output
{
    "InstanceRefreshId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
}

For more information, see Start an instance refresh in the Amazon EC2 Auto Scaling User Guide.

Example 2: To start an instance refresh using a JSON file

The following start-instance-refresh example starts an instance refresh using a JSON file. You can specify the Auto Scaling group and define your desired configuration and preferences in a JSON file, as shown in the following example.

aws autoscaling start-instance-refresh --cli-input-json file://config.jsonIdentify

Contents of config.json:

{
    "AutoScalingGroupName": "my-asg",
    "DesiredConfiguration": {
        "LaunchTemplate": {
            "LaunchTemplateId": "lt-068f72b729example",
            "Version": "$Default"
        }
    },
    "Preferences": {
        "InstanceWarmup": 60,
        "MinHealthyPercentage": 50,
        "AutoRollback": true,
        "ScaleInProtectedInstances": "Ignore",
        "StandbyInstances": "Terminate"
    }
}
Its output
{
    "InstanceRefreshId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
}

For more information, see Start an instance refresh in the Amazon EC2 Auto Scaling User Guide.

Options

4 in the AWS CLI reference
--auto-scaling-group-nameThe name of the Auto Scaling group.
--desired-configurationThe desired configuration.
--preferencesSets your preferences for the instance refresh so that it performs as expected when you start it.
--strategyThe strategy to use for the instance refresh.