1
+ AWSTemplateFormatVersion : " 2010-09-09"
2
+ Description : " DDB Table and IAM Managed Policies/Role for AWS KMS Hierarchical Keyring Testing"
3
+
4
+ Parameters :
5
+ TableName :
6
+ Type : String
7
+ Description : Test Table Name
8
+ Default : HierarchicalKeyringTestTable
9
+ KeyStoreTable :
10
+ Type : String
11
+ Description : Key Store Test Table Name
12
+ Default : KeyStoreTestTable
13
+ ProjectName :
14
+ Type : String
15
+ Description : A prefix that will be applied to any names
16
+ Default : Public-ESDK-Python
17
+ GitHubRepo :
18
+ Type : String
19
+ Description : GitHub Repo that invokes CI
20
+ Default : aws/aws-encryption-sdk-python
21
+
22
+ Resources :
23
+ GitHubCIRole :
24
+ Type : ' AWS::IAM::Role'
25
+ Properties :
26
+ RoleName : !Sub "GitHub-CI-${ProjectName}-Role-${AWS::Region}"
27
+ Description : " Access DDB, KMS, Resources for CI from GitHub"
28
+ ManagedPolicyArns :
29
+ - " arn:aws:iam::370957321024:policy/ESDK-Dafny-DDB-ReadWriteDelete-us-west-2"
30
+ - " arn:aws:iam::370957321024:policy/Hierarchical-GitHub-KMS-Key-Policy"
31
+ - " arn:aws:iam::370957321024:policy/KMS-Public-CMK-EncryptDecrypt-Key-Access"
32
+ - " arn:aws:iam::370957321024:policy/RSA-GitHub-KMS-Key-Policy"
33
+ AssumeRolePolicyDocument : !Sub |
34
+ {
35
+ "Version": "2012-10-17",
36
+ "Statement": [
37
+ {
38
+ "Effect": "Allow",
39
+ "Principal": { "Federated": "arn:aws:iam::${AWS::AccountId}:oidc-provider/token.actions.githubusercontent.com" },
40
+ "Action": "sts:AssumeRoleWithWebIdentity",
41
+ "Condition": {
42
+ "StringEquals": {
43
+ "token.actions.githubusercontent.com:aud": "sts.amazonaws.com"
44
+ },
45
+ "StringLike": {
46
+ "token.actions.githubusercontent.com:sub": "repo:${GitHubRepo}:*"
47
+ }
48
+ }
49
+ },
50
+ {
51
+ "Effect": "Allow",
52
+ "Principal": {
53
+ "AWS": "*"
54
+ },
55
+ "Action": "sts:AssumeRole",
56
+ "Condition": {
57
+ "StringEquals": {
58
+ "aws:PrincipalArn": [
59
+ "arn:aws:iam::587316601012:role/service-role/codebuild-python-esdk-CI-service-role",
60
+ "arn:aws:iam::587316601012:role/service-role/codebuild-python-esdk-service-role",
61
+ "arn:aws:iam::${AWS::AccountId}:role/ToolsDevelopment"
62
+ ]
63
+ }
64
+ }
65
+ }
66
+ ]
67
+ }
0 commit comments