Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion cdk/lib/cdk-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import {
PolicyDocument,
PolicyStatement,
FederatedPrincipal,
ArnPrincipal,
CompositePrincipal,
ManagedPolicy,
} from "aws-cdk-lib/aws-iam";
import {
Expand Down Expand Up @@ -170,11 +172,21 @@ export class S3ECPythonGithub extends cdk.Stack {
},
"sts:AssumeRoleWithWebIdentity"
)

// ToolsDevelopment role principal
const ToolsDevelopmentPrincipal = new ArnPrincipal("arn:aws:iam::" + this.account + ":role/ToolsDevelopment")

// Composite principal to allow both GitHub Actions and ToolsDevelopment to assume the role
const CompositePrincipalForRole = new CompositePrincipal(
GithubActionsPrincipal,
ToolsDevelopmentPrincipal
)

const S3ECGithubTestRole = new Role(
this,
"s3-github-test-role",
{
assumedBy: GithubActionsPrincipal,
assumedBy: CompositePrincipalForRole,
roleName: "S3EC-Python-Github-test-role",
description: " Grant GitHub S3 put and get and KMS encrypt, decrypt, and generate access for testing",
path: "/",
Expand Down
Loading