Test AWS pre and post scripts in AWS Console
About this task
Steps
-
Go to the AWS System Manager portal.
NOTE: Ensure that you have already created the SSM document.
- On the left panel, go to Node Management> Run Command.
- Choose the newly created document and its version.
- Select command parameters based on your custom document.
-
Select the targets manually.
NOTE: Ensure that your machine has an appropriate IAM role for SSM Managed instance and the SSM agent is running on your instance to be listed here. For more information about the IAM role and the SSM agent, see https://aws.amazon.com/premiumsupport/knowledge-center/systems-manager-ec2-instance-not-appear/
- Mention any additional parameters or output options.
- Choose the S3 bucket option if you want to collect the output logs of your SSM document script.
- Once you run this, you can check the progress of the command running on the target machine over the AWS System Manager portal.
-
In case it fails, you can select the instance ID and look for output.
Alternatively, you can use the following command:
aws ssm send-command --document-name "AWS-ConfigureDocker" --document-version "1" --targets '[{"Key":"InstanceIds","Values":["i-0e3ef0d01e6e2a4be"]}]' --parameters '{"action":["Install"]}' --timeout-seconds 600 --max-concurrency "50" --max-errors "0" --region us-east-1