-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(aws-cdk): asset bundling skipped when using --exclusively with custom stack name #19927
Comments
The pattern given to aws-cdk on the CLI is matched against `hierarchicalId` (i.e. displayName, node.path) [1] [2]. The same pattern is given to the CDK app but was matching against `stackName`, causing potential for bundling to be skipped under certain scenarios (i.e. using --exclusively with custom stack names). Closes aws#19927 [1] https://github.com/aws/aws-cdk/blob/6cca62db88866479f2b1d4f52b30beab3d78aeb2/packages/@aws-cdk/cx-api/lib/cloud-artifact.ts#L143-L145 [2] https://github.com/aws/aws-cdk/blob/6cca62db88866479f2b1d4f52b30beab3d78aeb2/packages/@aws-cdk/core/lib/stack-synthesizers/_shared.ts#L66
The pattern given to aws-cdk on the CLI is matched against `hierarchicalId` (i.e. displayName, node.path) [1] [2]. The same pattern is given to the CDK app but was matching against `stackName`, causing potential for bundling to be skipped under certain scenarios (i.e. using --exclusively with custom stack names). Closes aws#19927 [1] https://github.com/aws/aws-cdk/blob/6cca62db88866479f2b1d4f52b30beab3d78aeb2/packages/@aws-cdk/cx-api/lib/cloud-artifact.ts#L143-L145 [2] https://github.com/aws/aws-cdk/blob/6cca62db88866479f2b1d4f52b30beab3d78aeb2/packages/@aws-cdk/core/lib/stack-synthesizers/_shared.ts#L66
The pattern given to aws-cdk on the CLI is matched against `hierarchicalId` (i.e. displayName, node.path) [1] [2]. The same pattern is given to the CDK app but was matching against `stackName`, causing potential for bundling to be skipped under certain scenarios (i.e. using --exclusively with custom stack names). The skip bundling check has been changed to use the same value (node.path/hierarchicalId/displayName) as aws-cdk when deciding whether to bundle an asset, to make them consistent which ensures that if a stack is selected for deploy in aws-cdk it will not have bundling skipped. Closes aws#19927 [1] https://github.com/aws/aws-cdk/blob/6cca62db88866479f2b1d4f52b30beab3d78aeb2/packages/@aws-cdk/cx-api/lib/cloud-artifact.ts#L143-L145 [2] https://github.com/aws/aws-cdk/blob/6cca62db88866479f2b1d4f52b30beab3d78aeb2/packages/@aws-cdk/core/lib/stack-synthesizers/_shared.ts#L66
The pattern given to aws-cdk on the CLI is matched against `hierarchicalId` (i.e. displayName, node.path) [1] [2] [3]. The same pattern is given to the CDK app but was matching against `stackName`, causing potential for bundling to be skipped under certain scenarios (i.e. using --exclusively with custom stack names). The skip bundling check has been changed to use the same value (node.path/hierarchicalId/displayName) as aws-cdk when deciding whether to bundle an asset, to make them consistent which ensures that if a stack is selected for deploy in aws-cdk it will not have bundling skipped. Closes aws#19927 [1] https://github.com/aws/aws-cdk/blob/1d0270446b3effa6b8518de3c7d76f0c14e626c5/packages/aws-cdk/lib/api/cxapp/cloud-assembly.ts#L138 [2] https://github.com/aws/aws-cdk/blob/6cca62db88866479f2b1d4f52b30beab3d78aeb2/packages/@aws-cdk/cx-api/lib/cloud-artifact.ts#L143-L145 [3] https://github.com/aws/aws-cdk/blob/6cca62db88866479f2b1d4f52b30beab3d78aeb2/packages/@aws-cdk/core/lib/stack-synthesizers/_shared.ts#L66
The pattern given to aws-cdk on the CLI is matched against `hierarchicalId` (i.e. displayName, node.path) [1] [2] [3]. The same pattern is given to the CDK app but was matching against `stackName`, causing potential for bundling to be skipped under certain scenarios (i.e. using --exclusively with custom stack names). To make them consistent, the skip bundling check has been changed to use the same value (node.path/hierarchicalId/displayName) as aws-cdk when deciding whether to bundle an asset. Closes aws#19927 [1] https://github.com/aws/aws-cdk/blob/1d0270446b3effa6b8518de3c7d76f0c14e626c5/packages/aws-cdk/lib/api/cxapp/cloud-assembly.ts#L138 [2] https://github.com/aws/aws-cdk/blob/6cca62db88866479f2b1d4f52b30beab3d78aeb2/packages/@aws-cdk/cx-api/lib/cloud-artifact.ts#L143-L145 [3] https://github.com/aws/aws-cdk/blob/6cca62db88866479f2b1d4f52b30beab3d78aeb2/packages/@aws-cdk/core/lib/stack-synthesizers/_shared.ts#L66
The pattern given to aws-cdk on the CLI is matched against `hierarchicalId` (i.e. displayName, node.path) [1] [2] [3]. The same pattern is given to the CDK app but was matching against `stackName`, causing potential for bundling to be skipped under certain scenarios (i.e. using --exclusively with custom stack names). To make them consistent, the skip bundling check has been changed to use the same value (node.path/hierarchicalId/displayName) as aws-cdk when deciding whether to bundle an asset. fixes aws#19927 [1] https://github.com/aws/aws-cdk/blob/1d0270446b3effa6b8518de3c7d76f0c14e626c5/packages/aws-cdk/lib/api/cxapp/cloud-assembly.ts#L138 [2] https://github.com/aws/aws-cdk/blob/6cca62db88866479f2b1d4f52b30beab3d78aeb2/packages/@aws-cdk/cx-api/lib/cloud-artifact.ts#L143-L145 [3] https://github.com/aws/aws-cdk/blob/6cca62db88866479f2b1d4f52b30beab3d78aeb2/packages/@aws-cdk/core/lib/stack-synthesizers/_shared.ts#L66
@stevehodgkiss it looks like you have a PR to fix this. Someone from the team should pick up the PR |
Any ETA for this issue? My team is currently migrating multiple services to CDK and this is a blocker in some cases. |
This issue has received a significant amount of attention so we are automatically upgrading its priority. A member of the community will see the re-prioritization and provide an update on the issue. |
The pattern given to aws-cdk on the CLI is matched against `hierarchicalId` (i.e. displayName, node.path) [1] [2] [3]. The same pattern is given to the CDK app but was matching against `stackName`, causing potential for bundling to be skipped under certain scenarios (i.e. using --exclusively with custom stack names). To make them consistent, the skip bundling check has been changed to use the same value (node.path/hierarchicalId/displayName) as aws-cdk when deciding whether to bundle an asset. fixes aws#19927 [1] https://github.com/aws/aws-cdk/blob/1d0270446b3effa6b8518de3c7d76f0c14e626c5/packages/aws-cdk/lib/api/cxapp/cloud-assembly.ts#L138 [2] https://github.com/aws/aws-cdk/blob/6cca62db88866479f2b1d4f52b30beab3d78aeb2/packages/@aws-cdk/cx-api/lib/cloud-artifact.ts#L143-L145 [3] https://github.com/aws/aws-cdk/blob/6cca62db88866479f2b1d4f52b30beab3d78aeb2/packages/@aws-cdk/core/lib/stack-synthesizers/_shared.ts#L66
…cdk deploy CLI (#19950) The pattern given to aws-cdk on the CLI (`cdk deploy $pattern`) is matched against `stack.hierarchicalId` (i.e. displayName, node.path) [1] [2] [3]. The same pattern is given to the CDK app (as `bundlingStacks`) but is matching against `stackName`, causing potential for bundling to be skipped under certain scenarios (i.e. using --exclusively with custom stack names). To make them consistent, the skip bundling check has been changed to match against the same value as `cdk deploy $pattern` (node.path/hierarchicalId/displayName) when deciding whether to bundle an asset. Making them consistent ensures necessary stacks are bundled, avoiding the issue of uploading the entire project directory since the asset wasn't bundled. fixes #19927 [1] https://github.com/aws/aws-cdk/blob/1d0270446b3effa6b8518de3c7d76f0c14e626c5/packages/aws-cdk/lib/api/cxapp/cloud-assembly.ts#L138 [2] https://github.com/aws/aws-cdk/blob/6cca62db88866479f2b1d4f52b30beab3d78aeb2/packages/@aws-cdk/cx-api/lib/cloud-artifact.ts#L143-L145 [3] https://github.com/aws/aws-cdk/blob/6cca62db88866479f2b1d4f52b30beab3d78aeb2/packages/@aws-cdk/core/lib/stack-synthesizers/_shared.ts#L66 ---- ### All Submissions: * [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
@stevehodgkiss we had to revert the PR because it caused bundling to be skipped whenever the stack was part of a stage. The comment mentions that the stack name was intentionally converted from aws-cdk/packages/@aws-cdk/core/lib/stack.ts Line 1171 in 1fabd50
Done in this PR #17210 The correct fix may be to keep |
@corymhall ah, sorry about that. The issue seems to be related to how minimatch works when matching against strings containing ❯ npx ts-node
> const minimatch = require('minimatch')
'use strict' With > minimatch('stage/stack', '*')
false Converting to > minimatch('stage-stack', '*')
true Matches specifying > minimatch('stage/stack', 'stage/*')
true Perhaps, as you mention, the correct fix is to convert bundlingStacks.some(pattern => minimatch(
this.node.path.replace('/', '-'),
pattern.replace('/', '-'),
)); > minimatch('stage-stack', 'stage-*')
true Another option might be to use globstar ( aws-cdk/packages/@aws-cdk/core/lib/stack.ts Line 1169 in d7ac3bb
https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk/lib/api/cxapp/exec.ts#L43-L44 > minimatch('stage/stack', '**')
true |
The CDK CLI doesn't > minimatch('development-one/two'.replace('/', '-'), 'development/*'.replace('/', '-'))
true
> minimatch('development-one/two', 'development/*')
false Using globstar When a pattern isn't supplied on the CLI, minimatch isn't used to filter the stack list. Perhaps there's another way to simply return true if a pattern isn't supplied on the CLI (although |
I've created a draft PR that aims to address the issue the first PR had. Interested in your feedback @corymhall @kaizencc. #21248 |
…m stack name (#21248) Fixes #19927 [A previous PR](#19950) attempted this fix, but it caused another issue where the default pattern (`['*']`, used on cdk synth/deploy when a pattern isn't supplied) doesn't match stacks under a stage (`stage/stack`), and that caused bundling to be skipped. The default pattern worked (matched all stacks) previously because stackName was being used (and there are no `/` in stack names). See [this comment](#19927 (comment)) in the issue for more details on this. The first commit 5556b60 adds special handling to the default pattern so that it always returns true (bypassed minimatch which would return false if a stack is under a stage). The second commit a9a48a0 aims to remove the duplication of this pattern across the codebase, by defaulting `BUNDLING_STACKS` to `undefined` and returning true in bundlingRequired if that's the case. ---- ### All Submissions: * [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [Amazon.CDK.Lib](https://github.com/aws/aws-cdk) | nuget | minor | `2.45.0` -> `2.46.0` | --- ### Release Notes <details> <summary>aws/aws-cdk</summary> ### [`v2.46.0`](https://github.com/aws/aws-cdk/releases/v2.46.0) ##### Features - **aws-certificatemanager:** Add ability to specify the certificate name ([#​22301](https://github.com/aws/aws-cdk/issues/22301)) ([614ba92](https://github.com/aws/aws-cdk/commit/614ba92ba77e29c10ea4642a64e5b50b5dc775b8)) - **aws-ec2:** add metadata options support for launchTemplate construct ([#​22312](https://github.com/aws/aws-cdk/issues/22312)) ([9297bd0](https://github.com/aws/aws-cdk/commit/9297bd04884ebd05888fd14121256329dac82b43)) - **cfnspec:** cloudformation spec v92.0.0 ([#​22435](https://github.com/aws/aws-cdk/issues/22435)) ([064a1a6](https://github.com/aws/aws-cdk/commit/064a1a650c6f26d6a3087a8d39971ba33413d8ce)) - **cloudfront-origins:** allow setting a user defined origin id ([#​22349](https://github.com/aws/aws-cdk/issues/22349)) ([239215f](https://github.com/aws/aws-cdk/commit/239215fb8ceb4df5cd67669ad5daca39fb65543f)), closes [#​2756](https://github.com/aws/aws-cdk/issues/2756) - **ec2:** adds persist option to user data on windows instances ([#​21709](https://github.com/aws/aws-cdk/issues/21709)) ([cb1506f](https://github.com/aws/aws-cdk/commit/cb1506f090e36a6da78b8a8a1edf9a1256478311)) - **sns:** topic name with `.fifo` suffix generated automatically ([#​22375](https://github.com/aws/aws-cdk/issues/22375)) ([ba201cf](https://github.com/aws/aws-cdk/commit/ba201cf1d9768f9ac5d3328ec425bf566f088a16)), closes [#​18740](https://github.com/aws/aws-cdk/issues/18740) - **sqs:** add enforceSSL property to enforce encryption of data in transit ([#​22363](https://github.com/aws/aws-cdk/issues/22363)) ([f1886cf](https://github.com/aws/aws-cdk/commit/f1886cf82c50abc4e419f1450abfc3df0c5b0324)) ##### Bug Fixes - **apigateway:** cannot create an ApiKey with an imported RestApi ([#​22368](https://github.com/aws/aws-cdk/issues/22368)) ([83c4123](https://github.com/aws/aws-cdk/commit/83c4123273fda2a2e349b55f1e50d5afa1c7dd9d)), closes [#​22102](https://github.com/aws/aws-cdk/issues/22102) - **apigateway:** CORS OPTIONS method should not require auth ([#​22402](https://github.com/aws/aws-cdk/issues/22402)) ([ef72089](https://github.com/aws/aws-cdk/commit/ef72089d7cdf5dbaa1f172eecd29ee525f650b32)), closes [#​8615](https://github.com/aws/aws-cdk/issues/8615) - **core:** asset bundling skipped when using --exclusively with custom stack name ([#​21248](https://github.com/aws/aws-cdk/issues/21248)) ([209ddea](https://github.com/aws/aws-cdk/commit/209ddea44744509d74a080fdbd31cbb978fc8a96)), closes [/github.com/aws/aws-cdk/issues/19927#issuecomment-1189916912](https://github.com/aws//github.com/aws/aws-cdk/issues/19927/issues/issuecomment-1189916912) - some custom resources don't work in opt-in regions ([#​22370](https://github.com/aws/aws-cdk/issues/22370)) ([456a2c7](https://github.com/aws/aws-cdk/commit/456a2c75881fe8df3803db3787b48f8d9f97f09e)), closes [#​22022](https://github.com/aws/aws-cdk/issues/22022) - **cli:** state machine hotswap fails if the `DependsOn` change ([#​22396](https://github.com/aws/aws-cdk/issues/22396)) ([0d44db2](https://github.com/aws/aws-cdk/commit/0d44db2c211204b85002342ce758aca0552e851c)) - **core:** Custom Resource type length validation ([#​22118](https://github.com/aws/aws-cdk/issues/22118)) ([c186e2d](https://github.com/aws/aws-cdk/commit/c186e2ddcffb25647b971ba1b90faa850552d219)) - **custom-resources:** provider can fail if S3 has brown-outs ([#​22362](https://github.com/aws/aws-cdk/issues/22362)) ([cdedf60](https://github.com/aws/aws-cdk/commit/cdedf606277f50a2f7e20b09560f6e14b11bbc19)) - **ec2:** cannot deploy SecurityGroup with allowAllIpv6Outbound ([#​22414](https://github.com/aws/aws-cdk/issues/22414)) ([bb16d97](https://github.com/aws/aws-cdk/commit/bb16d9729daea2702b32df81fc8259b0afd652fa)), closes [#​22407](https://github.com/aws/aws-cdk/issues/22407) - **ecs:** removed explicit addition of ecs deployment type when circuit breaker is enabled ([#​22328](https://github.com/aws/aws-cdk/issues/22328)) ([635129c](https://github.com/aws/aws-cdk/commit/635129ca95313afef7b3d8fc62d077afbfd0c088)), closes [#​16126](https://github.com/aws/aws-cdk/issues/16126) [#​16919](https://github.com/aws/aws-cdk/issues/16919) - half-written asset zips can be uploaded if process is interrupted ([#​22393](https://github.com/aws/aws-cdk/issues/22393)) ([2ed006e](https://github.com/aws/aws-cdk/commit/2ed006e50b15dfca96395d442ccee648abdbb374)), closes [#​18459](https://github.com/aws/aws-cdk/issues/18459) ##### Reverts - "fix(ecs): removed explicit addition of ecs deployment type when circuit breaker is enabled ([#​22328](https://github.com/aws/aws-cdk/issues/22328))" ([#​22418](https://github.com/aws/aws-cdk/issues/22418)) ([0f002e2](https://github.com/aws/aws-cdk/commit/0f002e2009bbab2e10c08cdf908c5091ba61b754)), closes [/github.com/aws/aws-cdk/issues/16126#issuecomment-1271626957](https://github.com/aws//github.com/aws/aws-cdk/issues/16126/issues/issuecomment-1271626957) *** #### Alpha modules (2.46.0-alpha.0) ##### Features - **integ-tests:** add ability to `wait` for assertions to pass ([#​22335](https://github.com/aws/aws-cdk/issues/22335)) ([700f9c4](https://github.com/aws/aws-cdk/commit/700f9c4d465684b784f50ec74e897c9031a639c5)) - **integ-tests:** allow for user provided assertions stack ([#​22404](https://github.com/aws/aws-cdk/issues/22404)) ([39089f5](https://github.com/aws/aws-cdk/commit/39089f5eabc61c2a546391742ff2cf906f8e0f8b)) - **synthetics:** new runtime synthetics nodejs puppeteer 3 6 ([#​22374](https://github.com/aws/aws-cdk/issues/22374)) ([e0c0b56](https://github.com/aws/aws-cdk/commit/e0c0b56dded26a897dc6243298947bd4e69321b2)) ##### Bug Fixes - **appsync:** can not use Tokens in the name of a DataSource ([#​22378](https://github.com/aws/aws-cdk/issues/22378)) ([511eb79](https://github.com/aws/aws-cdk/commit/511eb79cba734bcd9e013d5dfbf262c75a522f09)), closes [#​18900](https://github.com/aws/aws-cdk/issues/18900) - **aws-lambda-python:** export poetry dependencies without hashes ([#​22351](https://github.com/aws/aws-cdk/issues/22351)) ([76482f6](https://github.com/aws/aws-cdk/commit/76482f6847a46806c1a309d2f9335a3d6e838fc6)), closes [#​14201](https://github.com/aws/aws-cdk/issues/14201) [#​19232](https://github.com/aws/aws-cdk/issues/19232) - **lambda-python:** commands run non-sequentially on Graviton when building container image ([#​22398](https://github.com/aws/aws-cdk/issues/22398)) ([e427fd6](https://github.com/aws/aws-cdk/commit/e427fd6f4a186784e345b8f88424d74c004f1e5a)), closes [#​22012](https://github.com/aws/aws-cdk/issues/22012) </details> --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [Amazon.CDK.Lib](https://github.com/aws/aws-cdk) | nuget | minor | `2.45.0` -> `2.46.0` | --- ### Release Notes <details> <summary>aws/aws-cdk</summary> ### [`v2.46.0`](https://github.com/aws/aws-cdk/releases/v2.46.0) ##### Features - **aws-certificatemanager:** Add ability to specify the certificate name ([#​22301](https://github.com/aws/aws-cdk/issues/22301)) ([614ba92](https://github.com/aws/aws-cdk/commit/614ba92ba77e29c10ea4642a64e5b50b5dc775b8)) - **aws-ec2:** add metadata options support for launchTemplate construct ([#​22312](https://github.com/aws/aws-cdk/issues/22312)) ([9297bd0](https://github.com/aws/aws-cdk/commit/9297bd04884ebd05888fd14121256329dac82b43)) - **cfnspec:** cloudformation spec v92.0.0 ([#​22435](https://github.com/aws/aws-cdk/issues/22435)) ([064a1a6](https://github.com/aws/aws-cdk/commit/064a1a650c6f26d6a3087a8d39971ba33413d8ce)) - **cloudfront-origins:** allow setting a user defined origin id ([#​22349](https://github.com/aws/aws-cdk/issues/22349)) ([239215f](https://github.com/aws/aws-cdk/commit/239215fb8ceb4df5cd67669ad5daca39fb65543f)), closes [#​2756](https://github.com/aws/aws-cdk/issues/2756) - **ec2:** adds persist option to user data on windows instances ([#​21709](https://github.com/aws/aws-cdk/issues/21709)) ([cb1506f](https://github.com/aws/aws-cdk/commit/cb1506f090e36a6da78b8a8a1edf9a1256478311)) - **sns:** topic name with `.fifo` suffix generated automatically ([#​22375](https://github.com/aws/aws-cdk/issues/22375)) ([ba201cf](https://github.com/aws/aws-cdk/commit/ba201cf1d9768f9ac5d3328ec425bf566f088a16)), closes [#​18740](https://github.com/aws/aws-cdk/issues/18740) - **sqs:** add enforceSSL property to enforce encryption of data in transit ([#​22363](https://github.com/aws/aws-cdk/issues/22363)) ([f1886cf](https://github.com/aws/aws-cdk/commit/f1886cf82c50abc4e419f1450abfc3df0c5b0324)) ##### Bug Fixes - **apigateway:** cannot create an ApiKey with an imported RestApi ([#​22368](https://github.com/aws/aws-cdk/issues/22368)) ([83c4123](https://github.com/aws/aws-cdk/commit/83c4123273fda2a2e349b55f1e50d5afa1c7dd9d)), closes [#​22102](https://github.com/aws/aws-cdk/issues/22102) - **apigateway:** CORS OPTIONS method should not require auth ([#​22402](https://github.com/aws/aws-cdk/issues/22402)) ([ef72089](https://github.com/aws/aws-cdk/commit/ef72089d7cdf5dbaa1f172eecd29ee525f650b32)), closes [#​8615](https://github.com/aws/aws-cdk/issues/8615) - **core:** asset bundling skipped when using --exclusively with custom stack name ([#​21248](https://github.com/aws/aws-cdk/issues/21248)) ([209ddea](https://github.com/aws/aws-cdk/commit/209ddea44744509d74a080fdbd31cbb978fc8a96)), closes [/github.com/aws/aws-cdk/issues/19927#issuecomment-1189916912](https://github.com/aws//github.com/aws/aws-cdk/issues/19927/issues/issuecomment-1189916912) - some custom resources don't work in opt-in regions ([#​22370](https://github.com/aws/aws-cdk/issues/22370)) ([456a2c7](https://github.com/aws/aws-cdk/commit/456a2c75881fe8df3803db3787b48f8d9f97f09e)), closes [#​22022](https://github.com/aws/aws-cdk/issues/22022) - **cli:** state machine hotswap fails if the `DependsOn` change ([#​22396](https://github.com/aws/aws-cdk/issues/22396)) ([0d44db2](https://github.com/aws/aws-cdk/commit/0d44db2c211204b85002342ce758aca0552e851c)) - **core:** Custom Resource type length validation ([#​22118](https://github.com/aws/aws-cdk/issues/22118)) ([c186e2d](https://github.com/aws/aws-cdk/commit/c186e2ddcffb25647b971ba1b90faa850552d219)) - **custom-resources:** provider can fail if S3 has brown-outs ([#​22362](https://github.com/aws/aws-cdk/issues/22362)) ([cdedf60](https://github.com/aws/aws-cdk/commit/cdedf606277f50a2f7e20b09560f6e14b11bbc19)) - **ec2:** cannot deploy SecurityGroup with allowAllIpv6Outbound ([#​22414](https://github.com/aws/aws-cdk/issues/22414)) ([bb16d97](https://github.com/aws/aws-cdk/commit/bb16d9729daea2702b32df81fc8259b0afd652fa)), closes [#​22407](https://github.com/aws/aws-cdk/issues/22407) - **ecs:** removed explicit addition of ecs deployment type when circuit breaker is enabled ([#​22328](https://github.com/aws/aws-cdk/issues/22328)) ([635129c](https://github.com/aws/aws-cdk/commit/635129ca95313afef7b3d8fc62d077afbfd0c088)), closes [#​16126](https://github.com/aws/aws-cdk/issues/16126) [#​16919](https://github.com/aws/aws-cdk/issues/16919) - half-written asset zips can be uploaded if process is interrupted ([#​22393](https://github.com/aws/aws-cdk/issues/22393)) ([2ed006e](https://github.com/aws/aws-cdk/commit/2ed006e50b15dfca96395d442ccee648abdbb374)), closes [#​18459](https://github.com/aws/aws-cdk/issues/18459) ##### Reverts - "fix(ecs): removed explicit addition of ecs deployment type when circuit breaker is enabled ([#​22328](https://github.com/aws/aws-cdk/issues/22328))" ([#​22418](https://github.com/aws/aws-cdk/issues/22418)) ([0f002e2](https://github.com/aws/aws-cdk/commit/0f002e2009bbab2e10c08cdf908c5091ba61b754)), closes [/github.com/aws/aws-cdk/issues/16126#issuecomment-1271626957](https://github.com/aws//github.com/aws/aws-cdk/issues/16126/issues/issuecomment-1271626957) *** #### Alpha modules (2.46.0-alpha.0) ##### Features - **integ-tests:** add ability to `wait` for assertions to pass ([#​22335](https://github.com/aws/aws-cdk/issues/22335)) ([700f9c4](https://github.com/aws/aws-cdk/commit/700f9c4d465684b784f50ec74e897c9031a639c5)) - **integ-tests:** allow for user provided assertions stack ([#​22404](https://github.com/aws/aws-cdk/issues/22404)) ([39089f5](https://github.com/aws/aws-cdk/commit/39089f5eabc61c2a546391742ff2cf906f8e0f8b)) - **synthetics:** new runtime synthetics nodejs puppeteer 3 6 ([#​22374](https://github.com/aws/aws-cdk/issues/22374)) ([e0c0b56](https://github.com/aws/aws-cdk/commit/e0c0b56dded26a897dc6243298947bd4e69321b2)) ##### Bug Fixes - **appsync:** can not use Tokens in the name of a DataSource ([#​22378](https://github.com/aws/aws-cdk/issues/22378)) ([511eb79](https://github.com/aws/aws-cdk/commit/511eb79cba734bcd9e013d5dfbf262c75a522f09)), closes [#​18900](https://github.com/aws/aws-cdk/issues/18900) - **aws-lambda-python:** export poetry dependencies without hashes ([#​22351](https://github.com/aws/aws-cdk/issues/22351)) ([76482f6](https://github.com/aws/aws-cdk/commit/76482f6847a46806c1a309d2f9335a3d6e838fc6)), closes [#​14201](https://github.com/aws/aws-cdk/issues/14201) [#​19232](https://github.com/aws/aws-cdk/issues/19232) - **lambda-python:** commands run non-sequentially on Graviton when building container image ([#​22398](https://github.com/aws/aws-cdk/issues/22398)) ([e427fd6](https://github.com/aws/aws-cdk/commit/e427fd6f4a186784e345b8f88424d74c004f1e5a)), closes [#​22012](https://github.com/aws/aws-cdk/issues/22012) </details> --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
Describe the bug
This is the same as or very similar to #12898.
When using a custom stack name, a stage and
cdk deploy "development/*" --exclusively
:Expected Behavior
Asset bundling shouldn't be incorrectly skipped.
There's a separate issue of if it is skipped, the entire repo shouldn't be bundled into a zip file and uploaded.
Current Behavior
Asset bundling is skipped, then the entire repo is uploaded instead of the zip file.
Reproduction Steps
CDK App:
yarn cdk deploy "development/*" --require-approval never
bundles the asset, and the stack is selected for deploy and works as expected.yarn cdk deploy "development/*" --require-approval never --exclusively
skips bundling, bundles the entire repo into an assets zip file instead of the lambda.Possible Solution
I think the issue is the pattern is matched against stackName in @aws-cdk/core to determine whether to bundle assets, whereas it's matched against hierarchicalId in aws-cdk to get the list of stacks to deploy. That's how bundling is skipped yet a deploy still happens.
heirarchicalId
is the stack logical name (development/CdkBundlingIssueStack
), whereas stackName in this case isCustomStackName
.I think the fix is to use
hierarchicalId
in@aws-cdk/core
to make the pattern matching consistent.Additional Information/Context
No response
CDK CLI Version
2.20.0
Framework Version
No response
Node.js Version
16.14.2
OS
MacOS
Language
Typescript
Language Version
No response
Other information
Relevant log lines with
--verbose
show the entire repo being bundled and uploaded, instead of the zip file. This is after asset bundling is skipped when it shouldn't be:The text was updated successfully, but these errors were encountered: