In this tutorial we explain the steps necessary to use script execution via scheduler in Cloud8.
EC2 Command:
- create an IAM Role with AmazonSSMFullAccess permission
- on the server where you want to run scripts, go to “Instance Settings -> Attach/Replace IAM Role” and associate the new IAM Role (mentioned in step 1) – Attention: server must have internet access, but does not need to have a public IP
- install SSM-AGENT on Windows/Linux according to http://docs.aws.amazon.com/systems-manager/latest/userguide/ssm-agent.html
- test (Virginia): https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#Documents:Owner=MeOrAmazon;sort=Name – Suggestion: use AWS-RunPowerShellScript (Windows) or AWS-RunShellScript (Linux) and run something harmless like ‘ipconfig’. Later, something more sophisticated can be used, such as copying files to S3: “aws cli s3 cp c:\home\* s://bucket/…”AWS documentation on remote commands:
http://docs.aws .amazon.com/AWSEC2/latest/UserGuide/execute-remote-commands.html - test scheduling on Cloud8: “Run Scripts” – you can pass AWS-RunPowerShellScript (Windows) or AWS-RunShellScript (Linux) and the parameters tested in step 4
Open the action schedule and select the server(s) where you will run the script(s):
Then enter the command type option to be used, “AWS-RunPowerShellScript” or “AWS-RunShellScript” . In the example we are scheduling the execution on a Linux server, so we will use “AWS-RunShellScript”:
Then click on the “Params” button and enter the command to be executed:
Okay, now just save the schedule and choose the recurrence (if applicable).