ApiOperationPolicy

Manages an API Management API Operation Policy

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleApiOperation = new Azure.ApiManagement.ApiOperation("exampleApiOperation", new Azure.ApiManagement.ApiOperationArgs
        {
        });
        //...
        var exampleApiOperationPolicy = new Azure.ApiManagement.ApiOperationPolicy("exampleApiOperationPolicy", new Azure.ApiManagement.ApiOperationPolicyArgs
        {
            ApiName = exampleApiOperation.ApiName,
            ApiManagementName = exampleApiOperation.ApiManagementName,
            ResourceGroupName = exampleApiOperation.ResourceGroupName,
            OperationId = exampleApiOperation.OperationId,
            XmlContent = @"<policies>
  <inbound>
    <find-and-replace from=""xyz"" to=""abc"" />
  </inbound>
</policies>
",
        });
    }

}
package main

import (
    "fmt"

    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/apimanagement"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        exampleApiOperation, err := apimanagement.NewApiOperation(ctx, "exampleApiOperation", nil)
        if err != nil {
            return err
        }
        _, err = apimanagement.NewApiOperationPolicy(ctx, "exampleApiOperationPolicy", &apimanagement.ApiOperationPolicyArgs{
            ApiName:           exampleApiOperation.ApiName,
            ApiManagementName: exampleApiOperation.ApiManagementName,
            ResourceGroupName: exampleApiOperation.ResourceGroupName,
            OperationId:       exampleApiOperation.OperationId,
            XmlContent:        pulumi.String(fmt.Sprintf("%v%v%v%v%v", "<policies>\n", "  <inbound>\n", "    <find-and-replace from=\"xyz\" to=\"abc\" />\n", "  </inbound>\n", "</policies>\n")),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_azure as azure

example_api_operation = azure.apimanagement.ApiOperation("exampleApiOperation")
#...
example_api_operation_policy = azure.apimanagement.ApiOperationPolicy("exampleApiOperationPolicy",
    api_name=example_api_operation.api_name,
    api_management_name=example_api_operation.api_management_name,
    resource_group_name=example_api_operation.resource_group_name,
    operation_id=example_api_operation.operation_id,
    xml_content="""<policies>
  <inbound>
    <find-and-replace from="xyz" to="abc" />
  </inbound>
</policies>
""")
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleApiOperation = new azure.apimanagement.ApiOperation("exampleApiOperation", {});
//...
const exampleApiOperationPolicy = new azure.apimanagement.ApiOperationPolicy("exampleApiOperationPolicy", {
    apiName: exampleApiOperation.apiName,
    apiManagementName: exampleApiOperation.apiManagementName,
    resourceGroupName: exampleApiOperation.resourceGroupName,
    operationId: exampleApiOperation.operationId,
    xmlContent: `<policies>
  <inbound>
    <find-and-replace from="xyz" to="abc" />
  </inbound>
</policies>
`,
});

Create a ApiOperationPolicy Resource

def ApiOperationPolicy(resource_name, opts=None, api_management_name=None, api_name=None, operation_id=None, resource_group_name=None, xml_content=None, xml_link=None, __props__=None);
name string
The unique name of the resource.
args ApiOperationPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ApiOperationPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ApiOperationPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

ApiOperationPolicy Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The ApiOperationPolicy resource accepts the following input properties:

ApiManagementName string

The name of the API Management Service. Changing this forces a new resource to be created.

ApiName string

The ID of the API Management API Operation within the API Management Service. Changing this forces a new resource to be created.

OperationId string
ResourceGroupName string

The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.

XmlContent string

The XML Content for this Policy.

XmlLink string

A link to a Policy XML Document, which must be publicly available.

ApiManagementName string

The name of the API Management Service. Changing this forces a new resource to be created.

ApiName string

The ID of the API Management API Operation within the API Management Service. Changing this forces a new resource to be created.

OperationId string
ResourceGroupName string

The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.

XmlContent string

The XML Content for this Policy.

XmlLink string

A link to a Policy XML Document, which must be publicly available.

apiManagementName string

The name of the API Management Service. Changing this forces a new resource to be created.

apiName string

The ID of the API Management API Operation within the API Management Service. Changing this forces a new resource to be created.

operationId string
resourceGroupName string

The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.

xmlContent string

The XML Content for this Policy.

xmlLink string

A link to a Policy XML Document, which must be publicly available.

api_management_name str

The name of the API Management Service. Changing this forces a new resource to be created.

api_name str

The ID of the API Management API Operation within the API Management Service. Changing this forces a new resource to be created.

operation_id str
resource_group_name str

The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.

xml_content str

The XML Content for this Policy.

xml_link str

A link to a Policy XML Document, which must be publicly available.

Outputs

All input properties are implicitly available as output properties. Additionally, the ApiOperationPolicy resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing ApiOperationPolicy Resource

Get an existing ApiOperationPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ApiOperationPolicyState, opts?: CustomResourceOptions): ApiOperationPolicy
static get(resource_name, id, opts=None, api_management_name=None, api_name=None, operation_id=None, resource_group_name=None, xml_content=None, xml_link=None, __props__=None);
func GetApiOperationPolicy(ctx *Context, name string, id IDInput, state *ApiOperationPolicyState, opts ...ResourceOption) (*ApiOperationPolicy, error)
public static ApiOperationPolicy Get(string name, Input<string> id, ApiOperationPolicyState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

ApiManagementName string

The name of the API Management Service. Changing this forces a new resource to be created.

ApiName string

The ID of the API Management API Operation within the API Management Service. Changing this forces a new resource to be created.

OperationId string
ResourceGroupName string

The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.

XmlContent string

The XML Content for this Policy.

XmlLink string

A link to a Policy XML Document, which must be publicly available.

ApiManagementName string

The name of the API Management Service. Changing this forces a new resource to be created.

ApiName string

The ID of the API Management API Operation within the API Management Service. Changing this forces a new resource to be created.

OperationId string
ResourceGroupName string

The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.

XmlContent string

The XML Content for this Policy.

XmlLink string

A link to a Policy XML Document, which must be publicly available.

apiManagementName string

The name of the API Management Service. Changing this forces a new resource to be created.

apiName string

The ID of the API Management API Operation within the API Management Service. Changing this forces a new resource to be created.

operationId string
resourceGroupName string

The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.

xmlContent string

The XML Content for this Policy.

xmlLink string

A link to a Policy XML Document, which must be publicly available.

api_management_name str

The name of the API Management Service. Changing this forces a new resource to be created.

api_name str

The ID of the API Management API Operation within the API Management Service. Changing this forces a new resource to be created.

operation_id str
resource_group_name str

The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.

xml_content str

The XML Content for this Policy.

xml_link str

A link to a Policy XML Document, which must be publicly available.

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.