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

terraform plan doesn't normalize IPv6 addresses in azurerm_dns_aaaa_record resources #5321

Closed
bbkane opened this issue Jan 6, 2020 · 3 comments
Assignees
Milestone

Comments

@bbkane
Copy link

bbkane commented Jan 6, 2020

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 (and AzureRM Provider) Version

λ terraform -v
Terraform v0.12.18
+ provider.azurerm v1.39.0

Affected Resource(s)

  • azurerm_dns_aaaa_record

Terraform Configuration Files

terraform {
  backend "local" {
    path = "terraform.tfstate"
  }
}

provider "azurerm" {
  # whilst the `version` attribute is optional, we recommend pinning to a given version of the Provider
  version = "~> 1.39"
}


resource "azurerm_resource_group" "B12_azure_aaaa_mismatch_repro" {
  name     = "12_azure_aaaa_mismatch_repro"
  location = "West US 2"
}

resource "azurerm_dns_zone" "BbbkaneScom" {
  name                = "bbkane.com"
  resource_group_name = azurerm_resource_group.B12_azure_aaaa_mismatch_repro.name
}


resource "azurerm_dns_aaaa_record" "azure_aaaa_record" {

  name                = "name-ipv6"
  zone_name           = azurerm_dns_zone.BbbkaneScom.name
  resource_group_name = azurerm_resource_group.B12_azure_aaaa_mismatch_repro.name
  ttl                 = 3600
  records             = ["2607:f8b0:4005:0800:0000:0000:0000:1003"]
}

Debug Output

From terraform plan after resource creation (TF_LOG=TRACE): https://gist.github.com/bbkane/1e427ff5d614cb5b7c7878e4aa51b9b8

Panic Output

No panic

Expected Behavior

With the above code:

terraform init  # initialize azure provider
terraform apply   # create resource group, zone, and AAAA record
terraform plan  # shouldn't do anything - all things already created and code not changed

Actual Behavior

terraform init  # initialize azure provider
terraform apply   # create resource group, zone, and AAAA record
terraform plan  # wants to "update" already created AAAA record with uncompressed version

See output of terraform plan:

λ terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

azurerm_resource_group.B12_azure_aaaa_mismatch_repro: Refreshing state... [id=/subscriptions/a9396794-7c83-412f-92c6-1e89857f8d96/resourceGroups/12_azure_aaaa_mismatch_repro]
azurerm_dns_zone.BbbkaneScom: Refreshing state... [id=/subscriptions/a9396794-7c83-412f-92c6-1e89857f8d96/resourceGroups/12_azure_aaaa_mismatch_repro/providers/Microsoft.Network/dnszones/bbkane.com]
azurerm_dns_aaaa_record.azure_aaaa_record: Refreshing state... [id=/subscriptions/a9396794-7c83-412f-92c6-1e89857f8d96/resourceGroups/12_azure_aaaa_mismatch_repro/providers/Microsoft.Network/dnszones/bbkane.com/AAAA/name-ipv6]

------------------------------------------------------------------------

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # azurerm_dns_aaaa_record.azure_aaaa_record will be updated in-place
  ~ resource "azurerm_dns_aaaa_record" "azure_aaaa_record" {
        fqdn                = "name-ipv6.bbkane.com."
        id                  = "/subscriptions/a9396794-7c83-412f-92c6-1e89857f8d96/resourceGroups/12_azure_aaaa_mismatch_repro/providers/Microsoft.Network/dnszones/bbkane.com/AAAA/name-ipv6"
        name                = "name-ipv6"
      ~ records             = [
          + "2607:f8b0:4005:0800:0000:0000:0000:1003",
          - "2607:f8b0:4005:800::1003",
        ]
        resource_group_name = "12_azure_aaaa_mismatch_repro"
        tags                = {}
        ttl                 = 3600
        zone_name           = "bbkane.com"
    }

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

------------------------------------------------------------------------

Note: You didn't specify an "-out" parameter to save this plan, so Terraform
can't guarantee that exactly these actions will be performed if
"terraform apply" is subsequently run.

Steps to Reproduce

mkdir AAAA_repro && cd AAAA_repro
terraform init  # initialize azure provider
terraform apply   # create resource group, zone, and AAAA record
terraform plan  # wants to "update" already created AAAA record with uncompressed version

Important Factoids

Nothing special

References

Nothing I could find.

@bbkane bbkane changed the title terraform plan doesn't normalize IPv6 addresses terraform plan doesn't normalize IPv6 addresses in azurerm_dns_aaaa_record resources Jan 6, 2020
@phires
Copy link
Contributor

phires commented Jan 10, 2020

I'll have a look into this

@WodansSon
Copy link
Collaborator

Sorry @tombuildsstuff, this one has been fixed and shipped in the last release. Sorry for the confusion.

@tombuildsstuff tombuildsstuff modified the milestones: v1.44.0, v1.43.0 Feb 7, 2020
@ghost
Copy link

ghost commented Mar 28, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants