Azure API Management Policy
This page shows how to write Terraform and Azure Resource Manager for API Management Policy and write them securely.
azurerm_api_management_policy (Terraform)
The Policy in API Management can be configured in Terraform with the resource name azurerm_api_management_policy. The following sections describe 1 example of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_api_management_policy" "policy" {
count = var.apim_default_policy_path==""?0:1
api_management_id = azurerm_api_management.apim.id
xml_content = file(var.apim_default_policy_path)
Parameters
-
api_management_idrequired - string -
idoptional computed - string -
xml_contentoptional computed - string -
xml_linkoptional - string -
timeoutssingle block
Explanation in Terraform Registry
Manages a API Management service Policy.
NOTE: This resource will, upon creation, overwrite any existing policy in the API Management service, as there is no feasible way to test whether the policy has been modified from the default. Similarly, when this resource is destroyed, the API Management service will revert to its default policy.
Microsoft.ApiManagement/service/policies (Azure Resource Manager)
The service/policies in Microsoft.ApiManagement can be configured in Azure Resource Manager with the resource name Microsoft.ApiManagement/service/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
apiVersionrequired - stringnamerequired - stringThe identifier of the Policy.
propertiesrequiredformatoptional - stringFormat of the policyContent.
valuerequired - stringContents of the Policy as defined by the format.
typerequired - string
Frequently asked questions
What is Azure API Management Policy?
Azure API Management 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 Policy?
For Terraform, the bee-a-learner/terraform source code example is useful. See the Terraform Example section for further details.