-
Notifications
You must be signed in to change notification settings - Fork 681
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
Graph issue when trying to remove a sec list #909
Comments
Hi @cosmindev , Do you have full debug logs for the repro with TF_LOG=DEBUG and OCI_GO_SDK_DEBUG=v variables enabled? I wonder if Terraform did an update of the oci_core_subnet first before it tried to delete the oci_core_security_list? The error you’re getting sounds like Terraform didn’t do the update first; and so it’s not able to delete the security list. |
Hi @cosmindev - I tried the scenario and Terraform tries to delete the security list first. Since subnet has a reference to it so ideally subnet should be updated first. Explained here If you are blocked, there is a work around mentioned in this comment. |
Hi @parrneet, Just wondering if this is a provider(OCI provider) or a TF issue. With other similar situations, things are working properly. For example, volumes and volume_groups:
|
@parrneet |
@cosmindev - This is bug in Terraform code where update/delete on a resource and its dependencies are not handled in a correct order always. |
When trying to remove an existing security list that is attached to a subnet, tf fails as it should first to destroy the association between the sec list and subnet and only after the sec_list
To reproduce the issue I've developed the following snippet:
To reproduce the issue:
terraform apply
withcount = 1
for the security list resource. All is created fineterraform apply
withcount = 0
for the security list resource. This is when it fails as it tries 1st to destroy the sec_list without destroying the sec_list - subnet association first:Error: Service error:IncorrectState. ocid1.securitylist.oc1.**** is associated with subnet security list association that is in use. http status code: 409. Opc request id: 34a5d892c5916271ea60c46182d0e68d/4FC52105B9A278BC880FB11879D095ED/AE3A7B83CABE5F63813640392F95DAB4
The complete error output:
The text was updated successfully, but these errors were encountered: