Azure API Management Product Policy
This page shows how to write Terraform and Azure Resource Manager for API Management Product Policy and write them securely.
azurerm_api_management_product_policy (Terraform)
The Product Policy in API Management can be configured in Terraform with the resource name azurerm_api_management_product_policy
. The following sections describe 5 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_api_management_product_policy" "this" {
api_management_name = var.api_management_name
product_id = var.product_id
resource_group_name = var.resource_group_name
xml_content = var.xml_content
xml_link = var.xml_link
resource "azurerm_api_management_product_policy" "this" {
api_management_name = var.api_management_name
product_id = var.product_id
resource_group_name = var.resource_group_name
xml_content = var.xml_content
xml_link = var.xml_link
resource "azurerm_api_management_product_policy" "api_management_product_policy" {
count = var.policy_xml == null ? 0 : 1
product_id = azurerm_api_management_product.api_management_product.product_id
api_management_name = var.api_management_name
resource_group_name = var.resource_group_name
resource "azurerm_api_management_product_policy" "this" {
count = var.policy_xml == null ? 0 : 1
product_id = azurerm_api_management_product.this.product_id
api_management_name = var.api_management_name
resource_group_name = var.resource_group_name
resource "azurerm_api_management_product_policy" "apim_product_policy" {
count = var.product_policy != "" ? 1 : 0
product_id = azurerm_api_management_product.product.product_id
api_management_name = azurerm_api_management_product.product.api_management_name
resource_group_name = azurerm_api_management_product.product.resource_group_name
Parameters
-
api_management_name
required - string -
id
optional computed - string -
product_id
required - string -
resource_group_name
required - string -
xml_content
optional computed - string -
xml_link
optional - string -
timeouts
single block
Explanation in Terraform Registry
Manages an API Management Product Policy
Microsoft.ApiManagement/service/products/policies (Azure Resource Manager)
The service/products/policies in Microsoft.ApiManagement can be configured in Azure Resource Manager with the resource name Microsoft.ApiManagement/service/products/policies
. 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 - stringThe identifier of the Policy.
properties
requiredformat
optional - stringFormat of the policyContent.
value
required - stringContents of the Policy as defined by the format.
type
required - string
Frequently asked questions
What is Azure API Management Product Policy?
Azure API Management Product Policy 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 Policy?
For Terraform, the kevinhead/azurerm, niveklabs/azurerm and pagopa/io-infrastructure-modules-new source code examples are useful. See the Terraform Example section for further details.