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

azurerm_api_management_api path validation too strict #7477

Closed
xinyi-joffre opened this issue Jun 24, 2020 · 3 comments · Fixed by #7478
Closed

azurerm_api_management_api path validation too strict #7477

xinyi-joffre opened this issue Jun 24, 2020 · 3 comments · Fixed by #7478

Comments

@xinyi-joffre
Copy link
Contributor

Terraform (and AzureRM Provider) Version

Terraform v0.12.26
AzureRM v2.8.0

Affected Resource(s)

azurerm_api_management_api

Terraform Configuration Files

resource "azurerm_api_management_api" "universal_links_api" {
  name                = "universal-links-api"
  resource_group_name = data.azurerm_resource_group.app_target_rg.name
  api_management_name = azurerm_api_management.apim.name
  revision            = "1"
  display_name        = "Universal Links"
  path                = ".well-known"
  protocols           = ["https"]
}

Expected Behavior

I can make an API with path of ".well-known" (this is so that I can support universal links in Apple, which require a path of .well-known/apple-app-site-association.

If I directly go against the Azure RM API, this succeeds:

{
  "id": "/subscriptions/<subid>/resourceGroups/<rg>/providers/Microsoft.ApiManagement/service/<apim>/apis/universal-links",
  "type": "Microsoft.ApiManagement/service/apis",
  "name": "universal-links",
  "properties": {
    "displayName": "Universal Links",
    "apiRevision": "1",
    "description": "",
    "subscriptionRequired": true,
    "serviceUrl": null,
    "path": ".well-known",
    "protocols": [
      "https"
    ],
    "authenticationSettings": {
      "oAuth2": null,
      "openid": null
    },
    "subscriptionKeyParameterNames": {
      "header": "Ocp-Apim-Subscription-Key",
      "query": "subscription-key"
    },
    "isCurrent": true
  }
}

Actual Behavior

If I deploy using terraform, I get the error:

Error: "path" may only be up to 400 characters in length, not start or end with `/` and only contain valid url characters

Steps to Reproduce

Use the provided configuration above to create an API with path of ".well-known".

@xinyi-joffre
Copy link
Contributor Author

I'm happy to fix this in a pull request

@ghost
Copy link

ghost commented Jun 25, 2020

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

@ghost
Copy link

ghost commented Jul 25, 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 Jul 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants