An AWS Systems Manager document (SSM document) the configuration options, policies, and the actions that Systems Manager performs on your managed instances and other AWS resources. Systems Manager includes more than a hundred pre-configured documents that you can use by specifying parameters at runtime. Documents use JavaScript Object Notation (JSON) or YAML, and they include steps and parameters that you specify.
There are multiple document types for different Systems Manager capabilities. They can be reviewed here:
You can use pre-defined AWS managed documents or create your own depending on your use case.
In this lab we will create a custom document that can be used with other Systems Manager capabilities Run Command and State Manager.
Select Create Command or session
org-install-app
.For Content, copy and paste the below snippet:
{
"schemaVersion": "2.2",
"description": "Command Document Example JSON Template",
"parameters": {
"Message": {
"type": "String",
"description": "Preparing Web Instance",
"default": ""
}
},
"mainSteps": [{
"action": "aws:runShellScript",
"name": "prepare_web_instance",
"inputs": {
"runCommand": [
"echo {{Message}}",
"sudo yum install httpd -y",
"mkdir /app",
"touch /app/hello.txt",
"sudo systemctl start httpd"
]
}
}]
}
Choose Create Document to save the document.
Choose the Owned by me tab and select the new document you created, org-install-app
.