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 statement of azurerm_api_management_custom_domain in the docs does not work #9600

Closed
w0ut0 opened this issue Dec 1, 2020 · 2 comments · Fixed by #9657
Closed

Import statement of azurerm_api_management_custom_domain in the docs does not work #9600

w0ut0 opened this issue Dec 1, 2020 · 2 comments · Fixed by #9657

Comments

@w0ut0
Copy link

w0ut0 commented Dec 1, 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 v0.13.5
+ provider registry.terraform.io/hashicorp/azurerm v2.38.0

Affected Resource(s)

  • azurerm_api_management_custom_domain

Terraform Configuration Files

resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West US"
}

resource "azurerm_api_management" "example" {
  name                = "example-apim"
  location            = azurerm_resource_group.test.location
  resource_group_name = azurerm_resource_group.test.name
  publisher_name      = "pub1"
  publisher_email     = "[email protected]"
  sku_name            = "Developer_1"
}

resource "azurerm_api_management_custom_domain" "example" {
  api_management_id = azurerm_api_management.example.id

  proxy {
    host_name    = "api.example.com"
    key_vault_id = azurerm_key_vault_certificate.test.secret_id
  }
}

Panic Output

Expected Behaviour

The custom hostnames of the Api Manager resource should be successfully managed by the new resource azurerm_api_management_custom_domain

Actual Behaviour

I get an error when following the documentation:

Error: ID was missing the `customDomains` element

Steps to Reproduce

  1. terraform import azurerm_api_management_custom_domain.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ApiManagement/service/instance1

Important Factoids

The following command works:
terraform import azurerm_api_management_custom_domain.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ApiManagement/service/instance1/customDomains/default

But I am not 100% sure whether we should update it in the documentation, or update the import functionality in the code (as /customDomains/default does not seem anything from Microsoft's side.

References

@ghost
Copy link

ghost commented Dec 4, 2020

This has been released in version 2.39.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.39.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Jan 3, 2021

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 as resolved and limited conversation to collaborators Jan 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants