terraform-oci-oke icon indicating copy to clipboard operation
terraform-oci-oke copied to clipboard

5.x: `create_iam_tag_namespace` is not indepotent after first creation

Open thpham opened this issue 2 years ago • 0 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version and Provider Version

Terraform v1.5.1
+ provider registry.terraform.io/hashicorp/cloudinit v2.3.2
+ provider registry.terraform.io/hashicorp/helm v2.10.1
+ provider registry.terraform.io/hashicorp/http v3.4.0
+ provider registry.terraform.io/hashicorp/null v3.2.1
+ provider registry.terraform.io/hashicorp/random v3.5.1
+ provider registry.terraform.io/hashicorp/time v0.9.1
+ provider registry.terraform.io/oracle/oci v5.4.0

Affected Resource(s)

  • modules/iam : tagging.tf -> tag_namespace_id_found + create_iam_tag_namespace local var.

the latest is then used as count boolean to create the resources oci_identity_tag_namespace + oci_identity_tag

Terraform Configuration Files

iam.tfvars

## IAM resources
create_iam_resources     = true // true/*false
create_iam_tag_namespace = true // true/*false
create_iam_defined_tags  = true // true/*false

Debug Output

Panic Output

Expected Behavior

when we run the terraform apply, then on the first run it creates the oci_identity_tag_namespace + oci_identity_tag resources, ok everything actually works. the following runs of plan/apply detects the resources exists and keep them.

Actual Behavior

when we run the terraform apply, then on the first run it creates the oci_identity_tag_namespace + oci_identity_tag resources, ok everything actually works, but then, when we run plan/apply it a second+ time, the logic detects they already exists and try to delete them.

Steps to Reproduce

Important Factoids

the issue seems related to the logic related to the create_iam_tag_namespace

References

thpham avatar Jul 27 '23 18:07 thpham