Manages a API Management service Policy.
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "West Europe"
}
resource "azurerm_api_management" "example" {
name = "example-apim"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
publisher_name = "pub1"
publisher_email = "pub1@email.com"
sku_name = "Developer_1"
}
resource "azurerm_api_management_named_value" "example" {
name = "example-apimg"
resource_group_name = azurerm_resource_group.example.name
api_management_name = azurerm_api_management.example.name
display_name = "ExampleProperty"
value = "Example Value"
}
resource "azurerm_api_management_policy" "example" {
api_management_id = azurerm_api_management.example.id
xml_content = file("example.xml")
}
The following arguments are supported:
api_management_id
- (Required) The ID of the API Management service. Changing this forces a new API Management service Policy to be created.xml_content
- (Optional) The XML Content for this Policy as a string. An XML file can be used here with Terraform's file function that is similar to Microsoft's PolicyFilePath
option.
xml_link
- (Optional) A link to a Policy XML Document, which must be publicly available.
In addition to the Arguments listed above - the following Attributes are exported:
id
- The ID of the API Management service Policy.The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 30 minutes) Used when creating the API Management service Policy.read
- (Defaults to 5 minutes) Used when retrieving the API Management service Policy.update
- (Defaults to 30 minutes) Used when updating the API Management service Policy.delete
- (Defaults to 30 minutes) Used when deleting the API Management service Policy.API Management service Policys can be imported using the resource id
, e.g.
terraform import azurerm_api_management_policy.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ApiManagement/service/service1