Alla Sasikanth
Alla Sasikanth

Reputation: 563

Automate AWS SSM document execution

I have an AWS SSM document shared from another account, to install a software on an EC2 instance. Since there are auto-scaled EC2 instances, depending on the demand, new instances spin up.

Requirement is to automate this document execution on all the SSM Managed EC2 instances every day at a specified time, so that no EC2 instance will be left out without the required software.

What are the ways I can use here? I tried using the Run Command feature, but the name of document does not show up in the list.

Upvotes: 0

Views: 2059

Answers (2)

Pankaj
Pankaj

Reputation: 1

  1. Write a Lambda function
  • Fetch list of EC2 instances,
  • use SSM (SendCommand) to run your document on each of the instances.
  1. Set up a Cloudwatch Event to invoke Lambda function daily at desired time.

Upvotes: 0

Matan Shabtay
Matan Shabtay

Reputation: 311

You can use SSM State Manager to automate the execution of that SSM document https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-state.html

Upvotes: 1

Related Questions