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
new ApiOperationPolicy(name: string, args: ApiOperationPolicyArgs, opts?: CustomResourceOptions);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);func NewApiOperationPolicy(ctx *Context, name string, args ApiOperationPolicyArgs, opts ...ResourceOption) (*ApiOperationPolicy, error)public ApiOperationPolicy(string name, ApiOperationPolicyArgs args, CustomResourceOptions? opts = null)- 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:
- Api
Management stringName The name of the API Management Service. Changing this forces a new resource to be created.
- Api
Name string The ID of the API Management API Operation within the API Management Service. Changing this forces a new resource to be created.
- Operation
Id string - Resource
Group stringName The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
- Xml
Content string The XML Content for this Policy.
- Xml
Link string A link to a Policy XML Document, which must be publicly available.
- Api
Management stringName The name of the API Management Service. Changing this forces a new resource to be created.
- Api
Name string The ID of the API Management API Operation within the API Management Service. Changing this forces a new resource to be created.
- Operation
Id string - Resource
Group stringName The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
- Xml
Content string The XML Content for this Policy.
- Xml
Link string A link to a Policy XML Document, which must be publicly available.
- api
Management stringName The name of the API Management Service. Changing this forces a new resource to be created.
- api
Name string The ID of the API Management API Operation within the API Management Service. Changing this forces a new resource to be created.
- operation
Id string - resource
Group stringName The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
- xml
Content string The XML Content for this Policy.
- xml
Link string A link to a Policy XML Document, which must be publicly available.
- api_
management_ strname 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_ strname 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:
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): ApiOperationPolicystatic 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:
- Api
Management stringName The name of the API Management Service. Changing this forces a new resource to be created.
- Api
Name string The ID of the API Management API Operation within the API Management Service. Changing this forces a new resource to be created.
- Operation
Id string - Resource
Group stringName The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
- Xml
Content string The XML Content for this Policy.
- Xml
Link string A link to a Policy XML Document, which must be publicly available.
- Api
Management stringName The name of the API Management Service. Changing this forces a new resource to be created.
- Api
Name string The ID of the API Management API Operation within the API Management Service. Changing this forces a new resource to be created.
- Operation
Id string - Resource
Group stringName The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
- Xml
Content string The XML Content for this Policy.
- Xml
Link string A link to a Policy XML Document, which must be publicly available.
- api
Management stringName The name of the API Management Service. Changing this forces a new resource to be created.
- api
Name string The ID of the API Management API Operation within the API Management Service. Changing this forces a new resource to be created.
- operation
Id string - resource
Group stringName The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
- xml
Content string The XML Content for this Policy.
- xml
Link string A link to a Policy XML Document, which must be publicly available.
- api_
management_ strname 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_ strname 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
azurermTerraform Provider.