Terraform-provider-azurerm: terraform plan doesn't normalize IPv6 addresses in azurerm_dns_aaaa_record resources

Created on 6 Jan 2020  ·  3Comments  ·  Source: terraform-providers/terraform-provider-azurerm

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.

bug servicdns

Most helpful comment

I'll have a look into this

All 3 comments

I'll have a look into this

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

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 👉 [email protected]. Thanks!

Was this page helpful?
0 / 5 - 0 ratings