oracle / terraform-provider-oci

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

Updating tags of public IP assigned to NAT gateway #2142

Open 12345ieee opened 3 months ago

12345ieee commented 3 months ago

Community Note

Terraform Version and Provider Version

Terraform v1.8.5
on linux_amd64
+ provider registry.terraform.io/hashicorp/null v3.2.2
+ provider registry.terraform.io/oracle/oci v5.44.0

Affected Resource(s)

oci_core_public_ip with oci_core_nat_gateway.

Terraform Configuration Files

resource "oci_core_public_ip" "myip" {
  compartment_id = var.compartment_id
  lifetime       = "RESERVED"

  defined_tags = var.defined_tags # <--- we're changing this map
}

resource "oci_core_nat_gateway" "mynat" {
  compartment_id = var.compartment_id
  vcn_id         = var.vcn_id

  public_ip_id = oci_core_public_ip.myip.id
}

Debug Output

None needed, plan goes through as one would expect:

  # oci_core_public_ip.myip will be updated in-place
  ~ resource "oci_core_public_ip" "myip" {
      ~ defined_tags         = {
           [REDACTED]
        }
        id                   = "[REDACTED]"
        # (10 unchanged attributes hidden)
    }

Panic Output

None happens.

Expected Behavior

Apply goes through.

Actual Behavior

Apply doesn't go through, errors with: Error: 404-NotAuthorizedOrNotFound, Cannot update public IP assigned to an entity of type NAT_GATEWAY but I'm just changing the tags, I should be allowed to do this.

Steps to Reproduce

  1. Create base config
  2. terraform apply
  3. Edit the tags map
  4. terraform apply

Important Factoids

None.

References

None.

tf-oci-pub commented 3 months ago

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