azurermApiManagementApiOperationPolicy
Manages an API Management API Operation Policy
Example Usage
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
new azurerm.provider.AzurermProvider(this, "azurerm", {
features: [{}],
});
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
this,
"example",
{
location: "West Europe",
name: "example-resources",
}
);
const azurermApiManagementExample = new azurerm.apiManagement.ApiManagement(
this,
"example_2",
{
location: azurermResourceGroupExample.location,
name: "example-apim",
publisher_email: "company@terraform.io",
publisher_name: "My Company",
resource_group_name: azurermResourceGroupExample.name,
sku_name: "Developer_1",
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermApiManagementExample.overrideLogicalId("example");
const azurermApiManagementApiExample =
new azurerm.apiManagementApi.ApiManagementApi(this, "example_3", {
api_management_name: azurermApiManagementExample.name,
name: "example-api",
resource_group_name: azurermResourceGroupExample.name,
revision: "1",
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermApiManagementApiExample.overrideLogicalId("example");
const azurermApiManagementApiOperationExample =
new azurerm.apiManagementApiOperation.ApiManagementApiOperation(
this,
"example_4",
{
api_management_name: azurermApiManagementExample.name,
api_name: azurermApiManagementApiExample.name,
display_name: "DELETE Resource",
method: "DELETE",
operation_id: "acctest-operation",
resource_group_name: azurermResourceGroupExample.name,
url_template: "/resource",
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermApiManagementApiOperationExample.overrideLogicalId("example");
const azurermApiManagementApiOperationPolicyExample =
new azurerm.apiManagementApiOperationPolicy.ApiManagementApiOperationPolicy(
this,
"example_5",
{
api_management_name:
azurermApiManagementApiOperationExample.apiManagementName,
api_name: azurermApiManagementApiOperationExample.apiName,
operation_id: azurermApiManagementApiOperationExample.operationId,
resource_group_name:
azurermApiManagementApiOperationExample.resourceGroupName,
xml_content:
'<policies>\n <inbound>\n <find-and-replace from="xyz" to="abc" />\n </inbound>\n</policies>\n',
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermApiManagementApiOperationPolicyExample.overrideLogicalId("example");
Argument Reference
The following arguments are supported:
-
apiName
- (Required) The name of the API within the API Management Service where the Operation exists. Changing this forces a new resource to be created. -
apiManagementName
- (Required) The name of the API Management Service. Changing this forces a new resource to be created. -
resourceGroupName
- (Required) The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created. -
operationId
- (Required) The operation identifier within an API. Must be unique in the current API Management service instance. Changing this forces a new resource to be created. -
xmlContent
- (Optional) The XML Content for this Policy. -
xmlLink
- (Optional) A link to a Policy XML Document, which must be publicly available.
Attributes Reference
In addition to all arguments above, the following attributes are exported:
id
- The ID of the API Management API Operation Policy.
Timeouts
The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 30 minutes) Used when creating the API Management API Operation Policy.update
- (Defaults to 30 minutes) Used when updating the API Management API Operation Policy.read
- (Defaults to 5 minutes) Used when retrieving the API Management API Operation Policy.delete
- (Defaults to 30 minutes) Used when deleting the API Management API Operation Policy.
Import
API Management API Operation Policy can be imported using the resourceId
, e.g.