oracle / terraform-provider-oci

Terraform Oracle Cloud Infrastructure provider
https://www.terraform.io/docs/providers/oci/
Mozilla Public License 2.0
758 stars 676 forks source link

Deleting identity domain fails #1781

Open F21 opened 1 year ago

F21 commented 1 year ago

Community Note

Terraform Version and Provider Version

Terraform v1.3.9 on linux_amd64

Affected Resource(s)

oci_identity_domain

Terraform Configuration Files

resource "oci_identity_domain" "test" {
  compartment_id = oci_identity_compartment.my_compartment.id
  description    = "test"
  display_name   = "test"
  home_region    = "ap-melbourne-1"
  license_type   = "free"
}

Debug Output

oci_identity_domain.secrets: Destroying... [id=ocid1.domain.oc1..aaaaaaasnipped]
╷
│ Error: 412-PreConditionFailed, Cannot perform DELETE_DOMAIN operation on Domain with Status CREATED
│ Suggestion: Please retry or contact support for help with service: Identity Domain
│ Documentation: https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/identity_domain
│ API Reference: https://docs.oracle.com/iaas/api/#/en/identity/20160918/Domain/DeleteDomain
│ Request Target: DELETE https://identity.ap-melbourne-1.oci.oraclecloud.com/20160918/domains/ocid1.domain.oc1..aaaaaaaasnipped
│ Provider version: 4.108.1, released on 2023-02-21.
│ Service: Identity Domain
│ Operation Name: DeleteDomain
│ OPC request ID: cd1cb3dc0ea24fd56d88fb4c23fd8215/F2snipped

Panic Output

None

Expected Behavior

Destroying an identity domain should work properly.

Actual Behavior

Destroying an identity domain returns the following error: Error: 412-PreConditionFailed, Cannot perform DELETE_DOMAIN operation on Domain with Status CREATED

Steps to Reproduce

  1. terraform apply
  2. terraform destroy

Important Factoids

None

References

API Docs: https://docs.oracle.com/en-us/iaas/api/#/en/identity/20160918/Domain/DeleteDomain

ravinitp commented 1 year ago

Thank you for reporting the issue. We have raised an internal ticket to track this. Our service engineers will get back to you.

rakeshnikam13 commented 1 year ago

The domain details passed in DELETE API do not exists. Can you please retry with correct details.

F21 commented 1 year ago

@rakeshnikam13 I removed the ocid of the domain in the logs for privacy reasons. As stated in the issue, the reason the delete is failing is because the provider does not deactivate the domain first before deleting, which causes it to fail.

This is fixed in my PR #1782

rakeshnikam13 commented 1 year ago

@F21 Thanks for fixing the issue. Can we close this ticket?

F21 commented 1 year ago

@rakeshnikam13 PR #1782 is still open and has not been merged. Maybe we should close this issue after that's been merged?

rajatjain1996 commented 9 months ago

Any update on this ? Can the above PR be merged?

aaker commented 5 months ago

This still seems to be an issue. Any update on when this issue will be addressed?