From bb1c5f2e44064701aefb79f6d8d832a03160acab Mon Sep 17 00:00:00 2001 From: Adam Moussa Date: Tue, 14 Jul 2026 13:27:42 -0400 Subject: [PATCH] Add stacks input to cd-cdk for multi-account apps cdk deploy was hardcoded to --all, which breaks when one CDK app defines stacks for two AWS accounts: whichever role the job assumed fails on the other account's stacks. Callers can now pass per-job stack selectors; default stays --all so existing callers are unaffected. --- .github/workflows/cd-cdk.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd-cdk.yaml b/.github/workflows/cd-cdk.yaml index a25e3ed..4d97898 100644 --- a/.github/workflows/cd-cdk.yaml +++ b/.github/workflows/cd-cdk.yaml @@ -35,6 +35,10 @@ on: description: "CloudFormation stack name (for pre-flight checks)" type: string default: "" + stacks: + description: "CDK stack selector(s) to deploy (space-separated construct ids/patterns). Default deploys every stack in the app; set per job when a multi-account app splits deploys across roles." + type: string + default: "--all" post-deploy-script: description: "Optional path to a script to run after CDK deploy (e.g. web build, S3 sync)" type: string @@ -121,7 +125,7 @@ jobs: - name: CDK deploy working-directory: ${{ inputs.cdk-dir }} - run: npx -y cdk deploy --all --require-approval never + run: npx -y cdk deploy ${{ inputs.stacks }} --require-approval never - name: Post-deploy script if: ${{ inputs.post-deploy-script != '' }}