- Lab
- A Cloud Guru
Executing Automation Workflow Using AWS SSM Automation
Systems Manager Automation enables you to run a sequence of workflows (e.g., AWS API calls, provisioning instances, creating buckets, and firing off Lambda functions) through the convenience of a single SSM Automation document. In this hands-on lab, we'll dive into a custom AWS SSM Automation document and see how it works. AWS Automation can help you automate mundane or repetitive tasks for maintenance or deployment of your hybrid infrastructure. Via a series of steps/actions defined in either JSON or YAML, SSM Automation offers useful plugins to carry out commands/API calls — thus opening up many possibilities for a hands-off approach to your hybrid infrastructure management.
Path Info
Table of Contents
-
Challenge
Log in to the AWS Management Console and Navigate to Systems Manager
- Log in to the AWS Management Console using the credentials provided.
- Navigate to the Systems Manager console.
- In the left-hand menu, click Automation (under Application Management).
-
Challenge
Create Automation Document
- Click Execute automation.
- Click Create Document, and choose the Editor tab.
- Click Edit. If a warning pops up, it's safe to ignore, so click OK.
- Copy the SSM Automation document JSON here.
- Paste the contents of the JSON document into the form under Editor, and click Create automation. You'll then be taken back to the Documents SSM page.
-
Challenge
Provide Inputs and Execute Automation Document
- On the upper part of the screen, click the Owned by me tab to list the Automation document we just created.
- Click Execute automation. You'll be taken to the configuration and input page for the Automation document.
- Leave EC2IamRole set to MyEC2SSMRole.
- In the Application dropdown, select the application you want to deploy. (In the lab video, we deploy mariadb-server.)
- Click Execute to run your automation.
-
Challenge
Track Automation Progress Status
Once you click Execute, you'll be taken to the main Automation page, where it will list all the steps in the automation, as well as actions and status against those steps.
Wait for the Automation status, which should be on top right side of the screen, to display Success.
Note: Automation can fail if any of the mandatory steps fail.
-
Challenge
Use Session Manager to Log in to SSM Automation's Spun-Up EC2 Instance
-
Navigate to Session Manager, click Start Session, and select the EC2 instance tagged SSM-Created-EC2.
-
Click Start session to start a shell session with the instance, and verify the Automation document successfully ran through and deployed as planned.
-
For
mariadb-server
input, use the following to verify:sudo systemctl status mariadb
This should show an
active/running
status.mysql -uroot -pmysecureencryptedpassword
This should log you in to the database shell prompt.
-
For
httpd
input, use the following to verify:sudo systemctl status httpd
This should show an
active/running
status.curl http://localhost
This should return a blob of HTML output confirming the web server is working.
-
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.