Closed akutz closed 6 years ago
Hi @denverwilliams,
Any thoughts on merging this functionality or the idea in general? I could have implemented it outside of Cross-Cloud, but it seemed like an appropriate place for it.
Hi @figo,
Would you mind please taking a look at this PR and providing any feedback you might have? Thank you!
Cleaning up resources when the Terraform state is not available/out of sync is a nice feature.
Ideally this would be something for all providers. We'll need to think of how that would be structured. The underlying docker container would also need to support the different provider specific tools as well she handle any conflicts...
This will take some thought.
Hi @taylor,
Well, this isn't something that can be implemented with the same toolsfor all providers. I think the way I implemented it for vSphere is a good model for the rest of the providers, but each provider will need to handle their own resources.
There are two aspects which could be generalized:
I was originally not going to make this part of the X-Cloud provider as we've a need for it in case environments are not destroyed. In other words, I don't want this PR to be blocked too long for a broader discussion. Thanks!
lgtm, thanks for the change.
This patch introduces the ability to destroy vSphere-provisioned environment without the need for the associated Terraform state. Passing the environment variable
VSPHERE_DESTROY_FORCE=true
to the provision image along with the standardCOMMAND=destroy
causes the environment to be destroyed using the scriptvsphere/destroy-force.sh
. This script:For example:
The environment variable may also be set to
VSPHERE_DESTROY_FORCE=dryrun
in order to print the commands that will be executed, but abstain from actually removing any resources. For example: