Skip to content

Commit 800eb44

Browse files
committed
chore(CI): migrate CB CI jobs to GHA
1 parent 2e63038 commit 800eb44

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

cfn.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
AWSTemplateFormatVersion: "2010-09-09"
2+
Description: "DDB Table and IAM Managed Policies/Role for AWS KMS Hierarchical Keyring Testing"
3+
4+
Parameters:
5+
ProjectName:
6+
Type: String
7+
Description: A prefix that will be applied to any names
8+
Default: DDBEC-Python
9+
GitHubRepo:
10+
Type: String
11+
Description: GitHub Repo that invokes CI
12+
Default: aws/aws-dynamodb-encryption-python
13+
14+
Resources:
15+
GitHubCIRole:
16+
Type: 'AWS::IAM::Role'
17+
Properties:
18+
RoleName: !Sub "GitHub-CI-${ProjectName}-Role-${AWS::Region}"
19+
Description: "Access KMS Resources for CI from GitHub"
20+
ManagedPolicyArns:
21+
- "arn:aws:iam::370957321024:policy/KMS-Public-CMK-EncryptDecrypt-Key-Access"
22+
AssumeRolePolicyDocument: !Sub |
23+
{
24+
"Version": "2012-10-17",
25+
"Statement": [
26+
{
27+
"Effect": "Allow",
28+
"Principal": { "Federated": "arn:aws:iam::${AWS::AccountId}:oidc-provider/token.actions.githubusercontent.com" },
29+
"Action": "sts:AssumeRoleWithWebIdentity",
30+
"Condition": {
31+
"StringEquals": {
32+
"token.actions.githubusercontent.com:aud": "sts.amazonaws.com"
33+
},
34+
"StringLike": {
35+
"token.actions.githubusercontent.com:sub": "repo:${GitHubRepo}:*"
36+
}
37+
}
38+
},
39+
{
40+
"Effect": "Allow",
41+
"Principal": {
42+
"AWS": "*"
43+
},
44+
"Action": "sts:AssumeRole",
45+
"Condition": {
46+
"StringEquals": {
47+
"aws:PrincipalArn": [
48+
"arn:aws:iam::${AWS::AccountId}:role/ToolsDevelopment"
49+
]
50+
}
51+
}
52+
}
53+
]
54+
}

0 commit comments

Comments
 (0)