-
Notifications
You must be signed in to change notification settings - Fork 22
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
[Enhancement] Policy folder does not delete when running a destroy #155
Comments
Hi there @hawksight , This is not bug, it's rather intended. I agree that for the regular devops usage for Terraform you'd spec this to be deleted on destroy, but back then we set an agreement to leave this as is (not having implemented the delete function), due to many implications that we would need to handle in Terraform to gracefully delete a "Policy" resource from remote platform using our Terraform provider. With all this said, I'll remove the "bug" label, as rather this should be considered an enhancement. Thanks a lot for creating this issue ticket. |
Hey @luispresuelVenafi thanks for taking a look at it. I understand from the Venafi side it's a question of.. :"what do you do with certificates inside that policy if it is deleted"? There's probably options so listing these out might help decide what a reasonable path is. (will try and think of them at some point) From a Terraform user's perspective there is already a way to prevent destruction of a resource for Production use cases, resource "aws_instance" "example" {
...
lifecycle {
prevent_destroy = true
}
} With this lifecycle provision we can hand of the decision to the Terraform user as with any other terraform resource. 💡 We could enhance or promote it's usage by detecting if not set and emitted a warning to the user if not set? 🤔 |
Sorry for late response. That's correct. To take into account this plugin have existed prior Terraform version when life cycle configuration was supported. Per the documention here:
starting version Terraform version 0.14.0. It should be ok to support it now, but as you mention, we need to think some ways to let know the user the implications I could think of following aspects:
Not sure if this fully makes sense. What do you think? |
PROBLEM SUMMARY
Terraform destroy will run and say it has completed and destroyed the Policy... but the policy will remain in TPP.
STEPS TO REPRODUCE
-destroy
EXPECTED RESULTS
If I destroy it in terraform I expect it to be delete in TPP.
ACTUAL RESULTS
Policy folder resources remain.
Some logs from Terraform:
Please Note: I am using a local build of the provider based on #154 to fix the certificate authentication for me.
Policy folder still exist:
ENVIRONMENT DETAILS
Terraform v1.9.5 on darwin_arm64 + provider registry.terraform.io/hashicorp/google v6.7.0 + provider registry.terraform.io/venafi/venafi v0.21.1 Your version of Terraform is out of date! The latest version is 1.9.8. You can update by downloading from https://www.terraform.io/downloads.html
COMMENTS/WORKAROUNDS
I have set the following scopes and am using the following customer application in TPP:
No workaround, manual cleanup required.
The text was updated successfully, but these errors were encountered: