hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.59k stars 4.62k forks source link

Updating API management service for azurerm_api_management_api and supporting translateRequiredQueryParameters property #21858

Open cemusta opened 1 year ago

cemusta commented 1 year ago

Is there an existing issue for this?

Community Note

Description

There is a new API management service versioned 2022-08-01. The current azurerm_api_management_api implementation uses 2021-08-01 and it's missing a new feature for openapi import.

API import is translating all required query parameters to template parameters by default. It can be set via API but Terraform resource is not updated to this new API nor have these fields.

image

This new import feature is available in API management UI too:

image

Adding translate_required_query_parameters field to terraform for create reason will bring this new functionality to terraform resource.

New or Affected Resource(s)/Data Source(s)

azurerm_api_management_api

Potential Terraform Configuration

resource "azurerm_api_management_api" "ciam_api" {
  name                = "example-api"
  resource_group_name = "rg-name"
  api_management_name = data.azurerm_api_management.dev_apim.name
  revision            = "1"
  display_name        = "Example API"
  path                = "example"
  protocols           = ["https"]

  translate_required_query_parameters = "query"

  import {
    content_format = "openapi+json"
    content_value  = file("${path.module}/example.json")
  }
}

References

Related bug ticket: https://github.com/hashicorp/terraform-provider-azurerm/issues/21852

santiago-perez-axa commented 8 months ago

Hello, Is this planned to be done in a near future? Thanks in advance.