I am trying to recreate the procedure in Tutorial: EBS Automated Snapshot Schedule Using CloudWatch Events using the AWS CLI. I almost finished with one step: setting AWS permissions (step 9).
Configure AWS Permissions Using the AWS Console
If I do all the other steps using the AWS CLI and step 9 using the AWS console, everything works fine - snapshots are taken periodically. I was even able to create a role that is identical to the one that was manually created in step 9 (using "aws iam create-role" and "aws iam put-role-policy"), but did not apply it to my rule.
Is there a way to set AWS permissions for a CloudWatch rule using the AWS CLI?
EDIT: Let me clarify this. I do the following:
$ aws iam create-role
$ aws iam put-role-policy
$ aws events put-rule
$ aws events put-targets
As a result:
- A CloudWatch rule is created and assigned with the appropriate purpose and role,
- AWS permissions are NOT specified as shown in this screenshot
- snapshots are NOT created unless I manually set AWS rights through the AWS console.
How can I set AWS permissions using the AWS CLI?
source
share