-
Notifications
You must be signed in to change notification settings - Fork 2
/
oidc.yaml
37 lines (34 loc) · 957 Bytes
/
oidc.yaml
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
Parameters:
FullRepoName:
Type: String
Default: telstrapurple/ptw-deploying-to-AWS-using-GitHub
AWSAccountID:
Type: String
Resources:
Role:
Type: AWS::IAM::Role
Properties:
RoleName: GitHubDeploymentRole
ManagedPolicyArns:
- arn:aws:iam::aws:policy/AdministratorAccess
AssumeRolePolicyDocument:
Statement:
- Effect: Allow
Action: sts:AssumeRoleWithWebIdentity
Principal:
Federated:
Ref: GithubOidc
Condition:
StringLike:
token.actions.githubusercontent.com:sub:
Fn::Sub: repo:${FullRepoName}:*
GithubOidc:
Type: AWS::IAM::OIDCProvider
Properties:
Url: https://token.actions.githubusercontent.com
ThumbprintList: [6938fd4d98bab03faadb97b34396831e3780aea1]
ClientIdList:
- sts.amazonaws.com
Outputs:
Role:
Value: !GetAtt Role.Arn