Created
June 4, 2020 14:34
-
-
Save dbazile/cb26f9aa8c19cffd84a2bbda51abcf35 to your computer and use it in GitHub Desktop.
cloudformation IAM example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Resources: | |
Bucket: | |
Type: AWS::S3::Bucket | |
Properties: | |
BucketName: test-bucketname | |
BucketPolicy: | |
Type: AWS::S3::BucketPolicy | |
Properties: | |
Bucket: !Ref Bucket | |
PolicyDocument: | |
Version: 2012-10-17 | |
Statement: | |
Action: | |
- s3:DeleteObject | |
- s3:GetObject | |
- s3:GetObjectAcl | |
- s3:ListBucket | |
- s3:PutObject | |
Effect: Allow | |
Principal: | |
AWS: !GetAtt 'ServiceAccount.Arn' | |
Resource: | |
- !Sub '${Bucket.Arn}/*' | |
- !Sub '${Bucket.Arn}' | |
ServiceAccount: | |
Type: AWS::IAM::User | |
Properties: | |
UserName: test-username | |
Policies: | |
- PolicyName: sqs-Read | |
PolicyDocument: | |
Version: 2012-10-17 | |
Statement: | |
Action: | |
- sqs:ReceiveMessage | |
Effect: Allow | |
Resource: | |
- !Sub 'arn:${AWS::Partition}:sqs:${AWS::Region}:${AWS::AccountId}:test-*' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment