Skip to content

Import of oci_core_vcn does not properly set IPv6 state #2215

Open
@nepeat

Description

@nepeat

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

OpenTofu v1.8.2
on darwin_arm64
+ provider registry.opentofu.org/hashicorp/oci v6.12.0

Affected Resource(s)

  • oci_core_vcn

Terraform Configuration Files

resource "oci_core_vcn" "prod-vcn" {
    compartment_id = "${var.compartment_id}"

    display_name = "prod-vcn"
    is_ipv6enabled = true
    is_oracle_gua_allocation_enabled = false
    
    cidr_blocks = [
        "10.0.0.0/16",
    ]
    ipv6private_cidr_blocks = [
        // redacted
        "xxxx:xxxx:xxxx:xxxx::/56",
    ]
}

Debug Output

Not attached due to amount of confidential data.

Panic Output

N/A

Expected Behavior

No changes. Your infrastructure matches the configuration.

When importing an already existing VCN with IPv6 enabled and already existing prefixes, I expect that the state would be consistent with the file.

  1. IPv6 enablement can be assumed to be true if there are prefixes that already exist in the VCN.

If the actual behaviour is expected, the documentation should state whether or not allowing Terraform to change these states on apply would have any impact on already deployed resources since it is not clear if changes will be made.

Actual Behavior

What actually happens when importing an already existing VCN is that it does the following

  1. is_ipv6enabled is defaulting to false, despite the existence of IPv6 prefixes and enablement of IPv6 in the VCN.
  2. is_oracle_gua_allocation_enabled does not have a default value, which makes it part of the state that needs to be changed.
OpenTofu used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

OpenTofu will perform the following actions:

  # oci_core_vcn.prod-vcn will be updated in-place
  ~ resource "oci_core_vcn" "prod-vcn" {
        id                               = "ocid1.vcn.oc1.region.id"
      ~ is_ipv6enabled                   = false -> true
      + is_oracle_gua_allocation_enabled = false
        # (14 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Steps to Reproduce

  1. tofu import oci_core_vcn.prod-vcn ocid1.vcn.oc1.region.id
  2. terraform plan

Important Factoids

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions