Azure API Management Product API
This page shows how to write Terraform and Azure Resource Manager for API Management Product API and write them securely.
azurerm_api_management_product_api (Terraform)
The Product API in API Management can be configured in Terraform with the resource name azurerm_api_management_product_api
. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_api_management_product_api" "apim_nodo_pagamenti_products_psp_c" {
product_id = module.apim_nodo_pagamenti_product[0].product_id
api_name = resource.azurerm_api_management_api.apim_nodo_pagamenti_api_psp_cli.name # api ref
api_management_name = module.apim.name
resource_group_name = azurerm_resource_group.rg_api.name
}
resource "azurerm_api_management_product_api" "product_link" {
resource_group_name = var.context.resource_group_name
api_name = azurerm_api_management_api.api.name
product_id = var.service_settings.product_id
resource "azurerm_api_management_product_api" "hmi_apim_product_api" {
api_name = azurerm_api_management_api.hmi_apim_api.name
product_id = azurerm_api_management_product.hmi_apim_product.product_id
api_management_name = azurerm_api_management.hmi_apim.name
resource_group_name = azurerm_resource_group.hmi_apim_rg.name
}
resource "azurerm_api_management_product_api" "pip_apim_product_api" {
api_name = azurerm_api_management_api.pip_apim_api.name
product_id = azurerm_api_management_product.pip_apim_product.product_id
api_management_name = azurerm_api_management.pip_apim.name
resource_group_name = azurerm_resource_group.pip_apim_rg.name
}
resource "azurerm_api_management_product_api" "hmi_apim_product_api" {
api_name = azurerm_api_management_api.hmi_apim_api.name
product_id = azurerm_api_management_product.hmi_apim_product.product_id
api_management_name = azurerm_api_management.hmi_apim.name
resource_group_name = azurerm_resource_group.hmi_apim_rg.name
}
resource "azurerm_api_management_product_api" "product_link" {
count = length(var.service_settings.product_id)
resource_group_name = var.context.resource_group_name
api_name = azurerm_api_management_api.api.name
resource "azurerm_api_management_product_api" "my-first-servicemyfirstproduct" {
resource_group_name = azurerm_resource_group.base.name
api_management_name = azurerm_api_management.base.name
product_id = azurerm_api_management_product.mydevelopers.product_id
api_name = "my-first-service"
}
resource "azurerm_api_management_product_api" "my-first-servicemyfirstproduct" {
resource_group_name = azurerm_resource_group.base.name
api_management_name = azurerm_api_management.base.name
product_id = azurerm_api_management_product.mydevelopers.product_id
api_name = "my-first-service"
}
resource "azurerm_api_management_product_api" "my-first-servicemyfirstproduct" {
resource_group_name = azurerm_resource_group.base.name
api_management_name = azurerm_api_management.base.name
product_id = azurerm_api_management_product.mydevelopers.product_id
api_name = "my-first-service"
}
resource "azurerm_api_management_product_api" "my-first-servicemyfirstproduct" {
resource_group_name = azurerm_resource_group.base.name
api_management_name = azurerm_api_management.base.name
product_id = azurerm_api_management_product.mydevelopers.product_id
api_name = "my-first-service"
}
Parameters
-
api_management_name
required - string -
api_name
required - string -
id
optional computed - string -
product_id
required - string -
resource_group_name
required - string -
timeouts
single block
Explanation in Terraform Registry
Manages an API Management API Assignment to a Product.
Microsoft.ApiManagement/service/products/apis (Azure Resource Manager)
The service/products/apis in Microsoft.ApiManagement can be configured in Azure Resource Manager with the resource name Microsoft.ApiManagement/service/products/apis
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
apiVersion
required - stringname
required - stringAPI revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
type
required - string
Frequently asked questions
What is Azure API Management Product API?
Azure API Management Product API is a resource for API Management of Microsoft Azure. Settings can be wrote in Terraform.
Where can I find the example code for the Azure API Management Product API?
For Terraform, the pagopa/pagopa-infra, aadi555/azurerm and hmcts/fh-hmi-api-gateway source code examples are useful. See the Terraform Example section for further details.