AWS Systems Manager
User Guide

AWS-PatchASGInstance

Description

Patch Amazon EC2 instances in an Auto Scaling group.

Document Type

Automation

Owner

Amazon

Platform(s)

Windows, Linux

Parameters

  • AutomationAssumeRole

    Type: String

    Description: (Optional) The ARN of the role that allows Automation to perform the actions on your behalf.

  • InstanceId

    Type: String

    Description: (Required) ID of the instance to patch. Don't specify an instance ID that is configured to run during a Maintenance Window.

  • LambdaRoleArn

    Type: String

    Description: (Optional) The ARN of the role that allows Lambda created by Automation to perform the actions on your behalf. If not specified a transient role will be created to execute the Lambda function.

  • WaitForInstance

    Type: String

    Default: PT2M

    Description: (Optional) Duration the Automation should sleep to allow the instance to come back into service.

  • WaitForReboot

    Type: String

    Default: PT5M

    Description: (Optional) Duration the Automation should sleep to allow a patched instance to reboot.

Examples

Start the automation

aws ssm start-automation-execution --document-name AWS-PatchAsgInstance --parameters parameters

Retrieve the execution output

aws ssm get-automation-execution --automation-execution-id EXECUTIONID --output text --query 'AutomationExecution.Output'

Document Steps

aws:createTags

aws:executeAutomation

aws:runCommand

aws:sleep

aws:executeAutomation

aws:createTags

aws:sleep

Outputs

None