You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
oci_identity_tag_default.these["k1"]: Creation complete after 20s [id=ocid1.tagdefault.oc1..aaaaaaaaok66fmb2opaeyh23dmnkojfok5skixokl5p565itbqrknh7lpdzq]
oci_identity_tag_default.these["k2"]: Creation complete after 21s [id=ocid1.tagdefault.oc1..aaaaaaaatubbjsipu6edraklbwlytclpcmj43rcogu22ijatue6nlab3zh3q]
oci_identity_tag_default.these["k3"]: Creation complete after 21s [id=ocid1.tagdefault.oc1..aaaaaaaalpcu55tfknyodrulkq4dxjcpnwvi6mcxf4uye7rxg7bdkm6jupaq]
time_sleep.tag_namespace: Still creating... [30s elapsed]
time_sleep.tag_namespace: Still creating... [40s elapsed]
time_sleep.tag_namespace: Still creating... [50s elapsed]
time_sleep.tag_namespace: Creation complete after 1m0s [id=2025-01-09T21:29:47Z]
|
│ Error: 404-NotAuthorizedOrNotFound, Failed to validate tags: TagNamespace ns does not exists
│ Suggestion: Either the resource has been deleted or service Identity Compartment need policy to access this resource. Policy reference: https://docs.oracle.com/en-us/iaas/Content/Identity/Reference/policyreference.htm
│ Documentation: https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/identity_compartment
│ API Reference: https://docs.oracle.com/iaas/api/#/en/identity/20160918/Compartment/CreateCompartment
│ Request Target: POST https://identity.ca-toronto-1.oci.oraclecloud.com/20160918/compartments
│ Provider version: 6.21.0, released on 2024-12-22. This provider is 2 Update(s) behind to current.
│ Service: Identity Compartment
│ Operation Name: CreateCompartment
│ OPC request ID: 18710a84a63e5944bbb2e37daec12bf3/918814DF2FCE2A476AC810DA648A244B/F3B5046303C59EAEC6DFBF30CFCC47D9
│
│
│ with oci_identity_compartment.this,
│ on 1.tf line 63, in resource "oci_identity_compartment" "this":
│ 63: resource "oci_identity_compartment" "this" {
Expected Behavior
As the code snippet above, right after creating defined tag namespace, defined tags and tag default values, creating any other resource using the just created defined tags should be fine.
Actual Behavior
As the code snippet above, right after creating the defined tag namespace, defined tags and tag default values, creating compartment and storage bucket failed if referencing the just created defined tags. 3 workaround tested as below.
Immediately re-run the script without any delay. This WORKS.
use time_sleep resource to create time delay(as from workaround 1, I thought it might be some delay). This DOES NOT work even after 60 seconds.
add depends_on argument directly depends on the tag namespace resource. This WORKS as well.
So, the problem doesn't seem to be time delay, instead, it's some dependency check on tag namespace is not working properly. This affects any resource that uses defined tags. Also the workaround only being tested using direct resource, not sure if it works for modules if namespace creation and resource creation are in different modules.
Steps to Reproduce
fill the necessary value, such as compartment ocid, storage namespace etc in the code snippet above.
comment out the "depends_on = [oci_identity_tag_namespace.this]" line
terraform apply
Important Factoids
References
The text was updated successfully, but these errors were encountered:
to add. it seems that this problem doesn't happen with modules. If I put the tag namespace creation in one module and resource creation(compartment, bucket etc) in another module, there is NO NEED to explicitly specify the dependency using the "depends_on" argument like in the code snippet above which are all pure resource in one script.
Community Note
Terraform Version and Provider Version
Terraform v1.8.5
on linux_amd64
Affected Resource(s)
oci_identity_tag_namespace
Terraform Configuration Files
Debug Output
=====================================================
Expected Behavior
As the code snippet above, right after creating defined tag namespace, defined tags and tag default values, creating any other resource using the just created defined tags should be fine.
Actual Behavior
As the code snippet above, right after creating the defined tag namespace, defined tags and tag default values, creating compartment and storage bucket failed if referencing the just created defined tags. 3 workaround tested as below.
So, the problem doesn't seem to be time delay, instead, it's some dependency check on tag namespace is not working properly. This affects any resource that uses defined tags. Also the workaround only being tested using direct resource, not sure if it works for modules if namespace creation and resource creation are in different modules.
Steps to Reproduce
terraform apply
Important Factoids
References
The text was updated successfully, but these errors were encountered: