-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathPublic-ESDK-Python-CI.yml
59 lines (57 loc) · 2.2 KB
/
Public-ESDK-Python-CI.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
53
54
55
56
57
58
59
AWSTemplateFormatVersion: "2010-09-09"
Description: "IAM Managed Policies/Role for AWS KMS Hierarchical Keyring Testing"
Parameters:
ProjectName:
Type: String
Description: A prefix that will be applied to any resource names
Default: Public-ESDK-Python
GitHubRepo:
Type: String
Description: GitHub Repo that invokes CI
Default: aws/aws-encryption-sdk-python
Resources:
GitHubCIRole:
Type: 'AWS::IAM::Role'
Properties:
RoleName: !Sub "GitHub-CI-${ProjectName}-Role-${AWS::Region}"
Description: "Access DDB, KMS, Resources for CI from GitHub"
ManagedPolicyArns:
- "arn:aws:iam::370957321024:policy/ESDK-Dafny-DDB-ReadWriteDelete-us-west-2"
- "arn:aws:iam::370957321024:policy/Hierarchical-GitHub-KMS-Key-Policy"
- "arn:aws:iam::370957321024:policy/KMS-Public-CMK-EncryptDecrypt-Key-Access"
- "arn:aws:iam::370957321024:policy/RSA-GitHub-KMS-Key-Policy"
AssumeRolePolicyDocument: !Sub |
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": { "Federated": "arn:aws:iam::${AWS::AccountId}:oidc-provider/token.actions.githubusercontent.com" },
"Action": "sts:AssumeRoleWithWebIdentity",
"Condition": {
"StringEquals": {
"token.actions.githubusercontent.com:aud": "sts.amazonaws.com"
},
"StringLike": {
"token.actions.githubusercontent.com:sub": "repo:${GitHubRepo}:*"
}
}
},
{
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "sts:AssumeRole",
"Condition": {
"StringEquals": {
"aws:PrincipalArn": [
"arn:aws:iam::587316601012:role/service-role/codebuild-python-esdk-CI-service-role",
"arn:aws:iam::587316601012:role/service-role/codebuild-python-esdk-service-role",
"arn:aws:iam::${AWS::AccountId}:role/ToolsDevelopment"
]
}
}
}
]
}