Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ashish111333
Copy link
Contributor

@ashish111333 ashish111333 commented Oct 25, 2025

added a preserve config flag to destroy Cmd now config is intact on pulumi destroy --remove --preserve-config.

closes #15069

@ashish111333 ashish111333 requested a review from a team as a code owner October 25, 2025 06:23
@github-actions
Copy link

PR is now waiting for a maintainer to take action.

Note for the maintainer: Commands available:

  • /run-acceptance-tests - used to test run the acceptance tests for the project
  • /run-codegen - used to test the Pull Request against downstream codegen
  • /run-docs-gen - used to test the Pull Request against documentation generation

@ashish111333 ashish111333 changed the title add preserve-config flag to destroy Add preserve-config flag to destroy Oct 25, 2025
Copy link
Member

@Frassle Frassle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a quick test, probably in tests/smoke/smoke_test.go but otherwise seems simple enough

@ashish111333
Copy link
Contributor Author

AR will add test.

}

if preserveConfig {
fmt.Printf("The resources in the stack have been deleted, and history is removed.\n")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and preserve Pulumi-{stack}.yml config file. We usually display further option to user with destroy command to how to further get rid of the config file.

&remove, "remove", false,
"Remove the stack and its config file after all resources in the stack have been deleted")
cmd.PersistentFlags().BoolVar(&preserveConfig, "preserve-config", false,
"preserves the stack config file")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

&remove, "remove", false,
"Remove the stack and its config file after all resources in the stack have been deleted")
cmd.PersistentFlags().BoolVar(&preserveConfig, "preserve-config", false,
"preserves the stack config file")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"preserves the stack config file")
"Preserve the stack config file")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a flag to pulumi destroy to delete the stack but keep the config

4 participants