Last active
July 18, 2018 00:32
-
-
Save nathanmalishev/6bf5a89ca309478e10ce7af851660d0f to your computer and use it in GitHub Desktop.
A snippet of the roles-stack for medium
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
WebAppRole: | |
Type: "AWS::IAM::Role" | |
Properties: | |
AssumeRolePolicyDocument: | |
Version: "2012-10-17" | |
Statement: | |
- Effect: "Allow" | |
Action: | |
- "sts:AssumeRole" | |
Principal: | |
AWS: | |
- !Sub "arn:aws:iam::${AWS::AccountId}:user/<ci_user>" | |
...... | |
...... | |
...... | |
BaseCloudFormationPolicy: | |
Type: "AWS::IAM::Policy" | |
Properties: | |
PolicyName: <ci_policy_name> | |
Users: | |
- !Ref <ci_user> ## attach to our ci_user | |
PolicyDocument: | |
Version: "2012-10-17" | |
Statement: | |
- Effect: "Allow" | |
... | |
... | |
- "cloudformation:ExecuteChangeSet" | |
- "cloudformation:DescribeStacks" | |
Resource: | |
## Can only execute specific stacks | |
- !Sub "arn:aws:cloudformation:${AWS::Region}:${AWS::AccountId}:stack/<web-stack>/*" | |
... | |
... | |
- Effect: "Allow" | |
Action: | |
- "sts:AssumeRole" ## we actually assume this role instead of pass. This is because we use | |
## s3 sync, instead of cloudformation cli & it doens't support --role-arn, only --profile | |
Resource: | |
- !Sub "arn:aws:iam::${AWS::AccountId}:role/webapp_deploy_role" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment