Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import of oci_core_vcn does not properly set IPv6 state #2215

Open
nepeat opened this issue Oct 10, 2024 · 1 comment
Open

Import of oci_core_vcn does not properly set IPv6 state #2215

nepeat opened this issue Oct 10, 2024 · 1 comment
Labels

Comments

@nepeat
Copy link

nepeat commented Oct 10, 2024

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

@nepeat nepeat added the bug label Oct 10, 2024
@nepeat
Copy link
Author

nepeat commented Oct 18, 2024

PR #2226 made to handle this concern. Awaiting response from the CLA team for approval into the overall corporate CLA.

I am not sure if this is the right solution but it seems if the is_ipv6enabled flag is set properly, it negates the check for is_oracle_gua_allocation_enabled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant