I'm pretty new to AWS so please bear with me.
I currently have this ecs.yaml
:
...
ECSSendMessageToSQSRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Statement:
- Effect: Allow
Principal:
Service:
- ecs-tasks.amazonaws.com
Action: sts:AssumeRole
Policies:
- PolicyName: ecs-service
PolicyDocument:
Statement:
- Effect: Allow
Action:
- ssm:*
- s3:*
Resource: '*'
As you can see, the Policy allows our role to access ALL S3 buckets and ALL SSM functionality.
I would like to change the permissions in such a way that:
- S3 Buckets: All actions allowed if we own the bucket.
- SSM: just allow a certain action called
GetParameter
, for example.
Any orientation on how to tackle this would be greatly appreciated.