-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcloudformation.yml
52 lines (49 loc) · 1.45 KB
/
cloudformation.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Parameters:
GitHubOrg:
Type: String
Default: Cloudbourn
Resources:
Role:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Statement:
- Effect: Allow
Action: sts:AssumeRoleWithWebIdentity
Principal:
Federated: !Ref GithubOidc
Condition:
StringLike:
token.actions.githubusercontent.com:sub: !Sub repo:${GitHubOrg}/*:*
ManagedPolicyArns:
- arn:aws:iam::aws:policy/PowerUserAccess # https://github.com/z0ph/MAMIP/blob/master/policies/PowerUserAccess
Policies:
- PolicyName: ModifySomeIAMButNotAll
PolicyDocument:
Statement:
- Effect: Allow
Action:
- iam:AttachRolePolicy
- iam:CreateRole
- iam:DeleteRole
- iam:DeleteRolePolicy
- iam:DetachRolePolicy
- iam:GetRole
- iam:GetRolePolicy
- iam:PassRole
- iam:PutRolePolicy
- iam:Tag*
- iam:Untag*
Resource:
- '*'
GithubOidc:
Type: AWS::IAM::OIDCProvider
Properties:
Url: https://token.actions.githubusercontent.com
ClientIdList:
- sts.amazonaws.com
ThumbprintList:
- 6938fd4d98bab03faadb97b34396831e3780aea1
Outputs:
Role:
Value: !GetAtt Role.Arn