From 2470cb01190ff661782a58379569d999eb81848d Mon Sep 17 00:00:00 2001 From: Markus Tacker Date: Thu, 12 Dec 2024 13:15:39 +0100 Subject: [PATCH] feat(cd): make environment name configurable --- cdk/ContinuousDeployment.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cdk/ContinuousDeployment.ts b/cdk/ContinuousDeployment.ts index 1858240..d2b4e7a 100644 --- a/cdk/ContinuousDeployment.ts +++ b/cdk/ContinuousDeployment.ts @@ -8,12 +8,14 @@ export class ContinuousDeployment extends Construct { { repository: { owner, repo }, gitHubOICDProviderArn, + environment, }: { repository: { owner: string repo: string } gitHubOICDProviderArn: string + environment?: string }, ) { super(parent, 'cd') @@ -30,7 +32,7 @@ export class ContinuousDeployment extends Construct { gitHubOIDC.openIdConnectProviderArn, { StringEquals: { - [`token.actions.githubusercontent.com:sub`]: `repo:${owner}/${repo}:environment:production`, + [`token.actions.githubusercontent.com:sub`]: `repo:${owner}/${repo}:environment:${environment ?? 'production'}`, [`token.actions.githubusercontent.com:aud`]: 'sts.amazonaws.com', }, },