-
Notifications
You must be signed in to change notification settings - Fork 4k
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
cdk destroy: No stack found in the main cloud assembly #32836
Labels
bug
This issue is a bug.
cli
Issues related to the CDK CLI
effort/medium
Medium work item – several days of effort
management/tracking
Issues that track a subject or multiple issues
p0
package/tools
Related to AWS CDK Tools or CLI
potential-regression
Marking this issue as a potential regression to be checked by team member
Comments
cporte
added
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
labels
Jan 10, 2025
github-actions
bot
added
potential-regression
Marking this issue as a potential regression to be checked by team member
package/tools
Related to AWS CDK Tools or CLI
labels
Jan 10, 2025
pahud
added
investigating
This issue is being investigated and/or work is in progress to resolve the issue.
and removed
needs-triage
This issue or PR still needs to be triaged.
labels
Jan 10, 2025
cloud be related to #32636 let me verify. |
I tried your code with a little bit fix #!/usr/bin/env node
import 'source-map-support/register';
import * as cdk from 'aws-cdk-lib';
import { Construct } from 'constructs';
const devEnv = {
account: process.env.CDK_DEFAULT_ACCOUNT,
region: process.env.CDK_DEFAULT_REGION
};
const app = new cdk.App();
export class DevStage extends cdk.Stage {
constructor(scope: Construct, id: string, props: cdk.StageProps) {
super(scope, id, props);
new NetworkStack(this, 'NetworkStack', {
env: props.env
});
}
}
export class LocalStage extends cdk.Stage {
constructor(scope: Construct, id: string, props: cdk.StageProps) {
super(scope, id, props);
new NetworkStack(this, 'NetworkStack', {
env: props.env
});
}
}
export class NetworkStack extends cdk.Stack {
constructor(scope: Construct, id: string, props: cdk.StackProps) {
super(scope, id, props);
}
}
new DevStage(app, 'DevStage', {env: devEnv});
new LocalStage(app, 'LocalStage', {env: devEnv}); deploy % npx cdk deploy "DevStage/*" "LocalStage/*" destroy % npx cdk destroy --force true 'Dev*/*'
No stack found in the main cloud assembly. Use "list" to print manifest
% npx cdk ls
DevStage/NetworkStack (DevStage-NetworkStack)
LocalStage/NetworkStack (LocalStage-NetworkStack)
% npx cdk --version
2.175.0 (build 703e81f)
% npx cdk destroy "LocalStage/NetworkStack"
No stack found in the main cloud assembly. Use "list" to print manifest downgrading to 2.174.1 fixes this issue % npx cdk destroy "LocalStage/NetworkStack"
Are you sure you want to delete: LocalStage/NetworkStack (y/n)? I can reproduce your case now. This seems to be a regression. |
pahud
added
cli
Issues related to the CDK CLI
p0
effort/medium
Medium work item – several days of effort
and removed
investigating
This issue is being investigated and/or work is in progress to resolve the issue.
labels
Jan 10, 2025
rix0rrr
added a commit
that referenced
this issue
Jan 10, 2025
Comments on closed issues and PRs are hard for our team to see. |
rix0rrr
added a commit
that referenced
this issue
Jan 10, 2025
rix0rrr
added
the
management/tracking
Issues that track a subject or multiple issues
label
Jan 10, 2025
rix0rrr
changed the title
cli: CDK destroy pretends no stack are found in the main cloud assembly
cdk destroy: No stack found in the main cloud assembly
Jan 10, 2025
rix0rrr
added a commit
to cdklabs/aws-cdk-notices
that referenced
this issue
Jan 10, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
This issue is a bug.
cli
Issues related to the CDK CLI
effort/medium
Medium work item – several days of effort
management/tracking
Issues that track a subject or multiple issues
p0
package/tools
Related to AWS CDK Tools or CLI
potential-regression
Marking this issue as a potential regression to be checked by team member
Please add your +1 👍 to let us know you have encountered this
Status: RESOLVED
Overview:
In version 2.175.0, running
cdk destroy <wildcard-pattern>
, with an application not containing any stacks at the top-level assembly, but only in nested stages, fails with the following error:Workaround:
Downgrade to 2.174.1 or upgrade to 2.175.1, or add an unused stack directly under the
App
.Solution:
Downgrade to 2.174.1 or upgrade to 2.175.1.
Related Issues:
Original issue
Describe the bug
Hello,
Since the version 2.175.0 of the CLI we can no longer run cdk destroy.
While cdk list does yield some result:
The problem is not related to the wildcard nor the specific stack naming.
(Same result with
cdk destroy --all
orcdk destroy 'DevStage/NetworkStack'
One specificity that might explain the issue, we are using the cdk.Stage class to organize our stacks, but we are not using the CodePipeline constructs (our CI/CD runs outside of AWS and calls the cdk commands using the wildcards)
We didn't try without this code structuration.
Regression Issue
Last Known Working CDK Version
2.174.1
Expected Behavior
Similar to 2.174.1 and before, it is expected to run the stack destruction for the given stacks (or all if --all is specified)
Current Behavior
the
cdk destroy
commands yield an error:No stack found in the main cloud assembly. Use "list" to print manifest
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.175.0
Framework Version
No response
Node.js Version
20.18.1
OS
Ubuntu 24.04
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: