AWS Systems Manager Run Command


AWS Control Tower
AWS Control Tower
PREVIEW19m 56s
Automating Patch and State Operations with AWS Systems Manager
Manage Instances using the AWS Systems Manager Run Command, Documents, & Parameter Store

The course is part of this learning path

Start course
1h 50m

This course covers the core learning objective to meet the requirements of the 'Architecting for Management & Governance in AWS - Level 3' skill

Learning Objectives:


  • Analyze how to design a multi-account AWS environment for complex organizations
  • Analyze an effective patch management strategy for your AWS resources
  • Analyze the most effective and appropriate logging and monitoring strategy for multiple resources
  • Evaluate an appropriate AWS offering(s) to enable configuration management automation

The systems manager “Run command” as the name suggests will permit you to execute a command on one or more of your instances.  The complexity of the command or commands to be executed is defined on a Systems Manager Document.  Documents define the actions that the agent performs on your instances and are shared resources in the systems manager console. 

Documents are written in JSON or YAML. They can be re-used and accept parameters.  With a document, you can run a shell script or perform any administrative task on a managed instance. There are dozens of pre-fabricated documents you can clone and modify or use as is.  A commonly used document with the Run command is the “AWS-RunShellScript” document.  

In general, the Run command will require that you specify a document and specify the target instances where the document is to be executed.  For any particular instance you see a status of a particular application as well as the output of a particular command on that instance.

If the number of instances is large, the run command also allows you to define a Rate Control.  

The rate control configuration for the run command uses concurrency to specify the number of targets on which to execute the document at the same time.  Also, it uses an Error threshold which indicates to stop the task after it fails on the specified number of instances.

Output options write command output to an Amazon S3 bucket or send command output to Amazon CloudWatch logs.  You can also configure systems manager to send notifications about command status using Amazon SNS.

About the Author
Jorge Negrón
AWS Content Architect
Learning Paths

Experienced in architecture and delivery of cloud-based solutions, the development, and delivery of technical training, defining requirements, use cases, and validating architectures for results. Excellent leadership, communication, and presentation skills with attention to details. Hands-on administration/development experience with the ability to mentor and train current & emerging technologies, (Cloud, ML, IoT, Microservices, Big Data & Analytics).