Closed ruzickap closed 2 years ago
Hi @ruzickap - I am not able to reproduce your issue. I can successfully destroy the enforcer groups easily, without hassle.
aquasec_enforcer_groups.auqa-enforcers-agent-kubernetes: Destroying... [id=tes-enforcer]
aquasec_enforcer_groups.auqa-enforcers-kube_enforcers-kubernetes: Destroying... [id=test-kube_enforcer]
aquasec_enforcer_groups.auqa-enforcers-kube_enforcers-kubernetes: Destruction complete after 1s
aquasec_enforcer_groups.auqa-enforcers-agent-kubernetes: Destruction complete after 1s
Destroy complete! Resources: 2 destroyed.
I have used your provided resource definition for enforcer groups creation and terraform v1.2.2.
Can you please provide the aqua version and type (SaaS or Enterprise) causing this issue?
I'm using Aqua SaaS 2022.4.71
.
When you reproduce it please try all these steps:
If you can not reproduce it - let me know - I'll record video showing the issue...
The important part is to have k8s cluster connected to the enforcer groups created by terraform before you do terraform destroy
.
Hi @ruzickap this is a known issue in the product API and we have a fix for that. We have added a fix in #138 that supports deleting disconnected enforcers in the delete enforcer API. Currently, the relate_deleted feature waiting for the product team to add into the 2022.4 version but it is there in the 6.5 and lower versions. Will merge the PR once the feature adds to 2022.4 aqua.
Thanks,
This issue was not fixed in latest aquasec provider v0.8.12
- I created new story to investigate: https://github.com/aquasecurity/terraform-provider-aquasec/issues/156
Terraform Aqua provider doesn't properly destroy "aquasec_enforcer_groups".
Terraform Version
Affected Resource(s)
Steps to Reproduce
I'm using this code to create enforcer groups in Aqua:
Once the enforcer groups are create I connected my k8s cluster and everything is working like expected:
The problem appeared when I try to run
terraform destroy
where I'm getting:When I delete the k8s cluster I can not destroy it either:
I need to manually delete connections in Aqua GUI and then I can destroy it:
-> Terraform should be able to destroy enforcer groups without any manual intervention.
Use case - we are creating / deleting k8s clusters for testing purposes therefore we would like to automate the whole process: