mirror of
https://github.com/Sea-Haven-Industries/.github.git
synced 2026-09-30 10:33:12 +00:00
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.
This commit is contained in:
parent
4505931ad8
commit
bb1c5f2e44
1 changed files with 5 additions and 1 deletions
6
.github/workflows/cd-cdk.yaml
vendored
6
.github/workflows/cd-cdk.yaml
vendored
|
|
@ -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 != '' }}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue