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

After importing azurerm_frontdoor_custom_https_configuration, resource must be re-created by Terraform #8103

Closed
nmiodice opened this issue Aug 12, 2020 · 3 comments · Fixed by #8173
Assignees
Milestone

Comments

@nmiodice
Copy link

nmiodice commented Aug 12, 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.28
+ provider.azurerm v2.20.0
+ provider.external v1.2.0
+ provider.local v1.4.0
+ provider.null v2.1.2
+ provider.random v2.3.0

Your version of Terraform is out of date! The latest version
is 0.13.0. You can update by downloading from https://www.terraform.io/downloads.html

Affected Resource(s)

  • azurerm_frontdoor_custom_https_configuration

Terraform Configuration Files

resource "azurerm_frontdoor_custom_https_configuration" "afd_https" {
  frontend_endpoint_id              = azurerm_frontdoor.afd.frontend_endpoint[1].id
  resource_group_name               = data.azurerm_resource_group.rg.name
  custom_https_provisioning_enabled = true
  custom_https_configuration {
    certificate_source = "FrontDoor"
  }
}

Debug Output

$ terraform import azurerm_frontdoor_custom_https_configuration.afd_https /subscriptions/.../resourcegroups/.../providers/Microsoft.Network/frontdoors/.../frontendendpoints/.../customHttpsConfiguration/...
...
Import successful!

The resources that were imported are shown above. These resources are now in
your Terraform state and will henceforth be managed by Terraform.
$ terraform state show azurerm_frontdoor_custom_https_configuration.afd_https
# azurerm_frontdoor_custom_https_configuration.afd_https:
resource "azurerm_frontdoor_custom_https_configuration" "afd_https" {
    custom_https_provisioning_enabled = true
    frontend_endpoint_id              = "..."
    id                                = "..."

    custom_https_configuration {
        certificate_source    = "FrontDoor"
        minimum_tls_version   = "1.2"
        provisioning_state    = "Enabled"
        provisioning_substate = "CertificateDeployed"
    }

    timeouts {}
}
$ terraform plan
...
  # azurerm_frontdoor_custom_https_configuration.afd_https must be replaced
-/+ resource "azurerm_frontdoor_custom_https_configuration" "afd_https" {
        custom_https_provisioning_enabled = true
        frontend_endpoint_id              = "..."
      ~ id                                = "..." -> (known after apply)
      + resource_group_name               = "..." # forces replacement

      ~ custom_https_configuration {
            certificate_source    = "FrontDoor"
          ~ minimum_tls_version   = "1.2" -> (known after apply)
          ~ provisioning_state    = "Enabled" -> (known after apply)
          ~ provisioning_substate = "CertificateDeployed" -> (known after apply)
        }

      - timeouts {}
    }
...

Panic Output

Expected Behavior

After importing the front door HTTPs configuration, terraform plan should not state that it requires to recreate the resource.

Actual Behavior

The import did not pick up the resource group; a resource group change forces a re-create of the resource; terraform thinks it needs to re-create the configuration

Steps to Reproduce

See debug output

Important Factoids

References

@nmiodice
Copy link
Author

nmiodice commented Aug 19, 2020

@tombuildsstuff or @mybayern1974 , do you know of any workarounds until the proper fix can be implemented?

@ghost
Copy link

ghost commented Aug 20, 2020

This has been released in version 2.24.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.24.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Sep 19, 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 👉 [email protected]. Thanks!

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