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

Updating the infoblox_ip_allocation will not update allocated_ipv6_addr #377

Open
pawelos99 opened this issue Jul 29, 2024 · 0 comments
Open

Comments

@pawelos99
Copy link

For a given terraform infoblox_ip_allocation definition:

terraform {
  required_providers {
    infoblox = {
      source  = "infobloxopen/infoblox"
      version = "~> 2.7.0"
    }
  }
}

resource "infoblox_ip_allocation" "load_balancers" {
  fqdn  = "<your fqdn>"
  ipv4_cidr = "<your ipv4 cidr>"
  ipv6_cidr = null
}

output "load_balancer_vip_ipv6" {
  value     = infoblox_ip_allocation.load_balancers.allocated_ipv6_addr
}

output "load_balancer_vip_ipv4" {
  value     = infoblox_ip_allocation.load_balancers.allocated_ipv4_addr
}

running terraform apply will create infoblox_ip_allocation with allocated_ipv4_addr and empty allocated_ipv6_addr:

terraform apply

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # infoblox_ip_allocation.load_balancers will be created
  + resource "infoblox_ip_allocation" "load_balancers" {
      + allocated_ipv4_addr = (known after apply)
      + allocated_ipv6_addr = (known after apply)
      + dns_view            = (known after apply)
      + enable_dns          = true
      + fqdn                = "<your fqdn>"
      + id                  = (known after apply)
      + internal_id         = (known after apply)
      + ipv4_cidr           = "<your ipv4 cidr>"
      + network_view        = "default"
      + ref                 = (known after apply)
      + ttl                 = -2147483648
    }

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

Changes to Outputs:
  + load_balancer_vip_ipv4 = (known after apply)
  + load_balancer_vip_ipv6 = (known after apply)

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

infoblox_ip_allocation.load_balancers: Creating...
infoblox_ip_allocation.load_balancers: Creation complete after 1s [id=99960f1e-b033-4606-a94a-d552346250df]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

Outputs:

load_balancer_vip_ipv4 = "<ipv4 addr>"
load_balancer_vip_ipv6 = ""

But now adding the ipv6_cidr:

resource "infoblox_ip_allocation" "load_balancers" {
  fqdn  = "<your fqdn>"
  ipv4_cidr = "<your ipv4 cidr>"
  ipv6_cidr = "<your ipv6 cidr>"
}

will not output allocated_ipv6_addr (note that the output is still empty) even if it was correctly created by infoblox:

terraform apply
infoblox_ip_allocation.load_balancers: Refreshing state... [id=99960f1e-b033-4606-a94a-d552346250df]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # infoblox_ip_allocation.load_balancers will be updated in-place
  ~ resource "infoblox_ip_allocation" "load_balancers" {
        id                  = "99960f1e-b033-4606-a94a-d552346250df"
      + ipv6_cidr           = "<your ipv6 cidr>"
        # (11 unchanged attributes hidden)
    }

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

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

infoblox_ip_allocation.load_balancers: Modifying... [id=99960f1e-b033-4606-a94a-d552346250df]
infoblox_ip_allocation.load_balancers: Modifications complete after 1s [id=99960f1e-b033-4606-a94a-d552346250df]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

Outputs:

load_balancer_vip_ipv4 = "<ipv4 addr>"
load_balancer_vip_ipv6 = ""

only a terraform refresh or another terraform apply will set this value correctly.

Suspicious logs when the trace logging is enabled:

2024-07-29T17:00:05.960+0200 [WARN]  Provider "provider[\"registry.terraform.io/infobloxopen/infoblox\"]" produced an unexpected new value for infoblox_ip_allocation.load_balancers, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .allocated_ipv6_addr: was cty.StringVal(""), but now cty.StringVal("<new ipv6 addr>")

terraform version:

terraform --version
Terraform v1.9.1
on linux_amd64
+ provider registry.terraform.io/hashicorp/null v3.2.2
+ provider registry.terraform.io/infobloxopen/infoblox v2.7.0

Your version of Terraform is out of date! The latest version
is 1.9.3. You can update by downloading from https://www.terraform.io/downloads.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant