RuleArgs

data class RuleArgs(val actions: Output<List<Any>>? = null, val conditions: Output<List<Any>>? = null, val matchProcessingBehavior: Output<Either<String, MatchProcessingBehavior>>? = null, val order: Output<Int>? = null, val profileName: Output<String>? = null, val resourceGroupName: Output<String>? = null, val ruleName: Output<String>? = null, val ruleSetName: Output<String>? = null) : ConvertibleToJava<RuleArgs>

Friendly Rules name mapping to the any Rules or secret related information. Uses Azure REST API version 2023-05-01. In version 1.x of the Azure Native provider, it used API version 2020-09-01. Other available API versions: 2023-07-01-preview, 2024-02-01, 2024-05-01-preview, 2024-06-01-preview, 2024-09-01.

Example Usage

Rules_Create

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var rule = new AzureNative.Cdn.Rule("rule", new()
{
Actions = new[]
{
new AzureNative.Cdn.Inputs.DeliveryRuleResponseHeaderActionArgs
{
Name = "ModifyResponseHeader",
Parameters = new AzureNative.Cdn.Inputs.HeaderActionParametersArgs
{
HeaderAction = AzureNative.Cdn.HeaderAction.Overwrite,
HeaderName = "X-CDN",
TypeName = "DeliveryRuleHeaderActionParameters",
Value = "MSFT",
},
},
},
Conditions = new[]
{
new AzureNative.Cdn.Inputs.DeliveryRuleRequestMethodConditionArgs
{
Name = "RequestMethod",
Parameters = new AzureNative.Cdn.Inputs.RequestMethodMatchConditionParametersArgs
{
MatchValues = new[]
{
"GET",
},
NegateCondition = false,
Operator = AzureNative.Cdn.RequestMethodOperator.Equal,
TypeName = "DeliveryRuleRequestMethodConditionParameters",
},
},
},
Order = 1,
ProfileName = "profile1",
ResourceGroupName = "RG",
RuleName = "rule1",
RuleSetName = "ruleSet1",
});
});
package main
import (
cdn "github.com/pulumi/pulumi-azure-native-sdk/cdn/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := cdn.NewRule(ctx, "rule", &cdn.RuleArgs{
Actions: pulumi.Array{
cdn.DeliveryRuleResponseHeaderAction{
Name: "ModifyResponseHeader",
Parameters: cdn.HeaderActionParameters{
HeaderAction: cdn.HeaderActionOverwrite,
HeaderName: "X-CDN",
TypeName: "DeliveryRuleHeaderActionParameters",
Value: "MSFT",
},
},
},
Conditions: pulumi.Array{
cdn.DeliveryRuleRequestMethodCondition{
Name: "RequestMethod",
Parameters: cdn.RequestMethodMatchConditionParameters{
MatchValues: []string{
"GET",
},
NegateCondition: false,
Operator: cdn.RequestMethodOperatorEqual,
TypeName: "DeliveryRuleRequestMethodConditionParameters",
},
},
},
Order: pulumi.Int(1),
ProfileName: pulumi.String("profile1"),
ResourceGroupName: pulumi.String("RG"),
RuleName: pulumi.String("rule1"),
RuleSetName: pulumi.String("ruleSet1"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.cdn.Rule;
import com.pulumi.azurenative.cdn.RuleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var rule = new Rule("rule", RuleArgs.builder()
.actions(DeliveryRuleCacheExpirationActionArgs.builder()
.name("ModifyResponseHeader")
.parameters(CacheExpirationActionParametersArgs.builder()
.headerAction("Overwrite")
.headerName("X-CDN")
.typeName("DeliveryRuleHeaderActionParameters")
.value("MSFT")
.build())
.build())
.conditions(DeliveryRuleRequestMethodConditionArgs.builder()
.name("RequestMethod")
.parameters(RequestMethodMatchConditionParametersArgs.builder()
.matchValues("GET")
.negateCondition(false)
.operator("Equal")
.typeName("DeliveryRuleRequestMethodConditionParameters")
.build())
.build())
.order(1)
.profileName("profile1")
.resourceGroupName("RG")
.ruleName("rule1")
.ruleSetName("ruleSet1")
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:cdn:Rule rule1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/rules/{ruleName}

Constructors

Link copied to clipboard
constructor(actions: Output<List<Any>>? = null, conditions: Output<List<Any>>? = null, matchProcessingBehavior: Output<Either<String, MatchProcessingBehavior>>? = null, order: Output<Int>? = null, profileName: Output<String>? = null, resourceGroupName: Output<String>? = null, ruleName: Output<String>? = null, ruleSetName: Output<String>? = null)

Properties

Link copied to clipboard
val actions: Output<List<Any>>? = null

A list of actions that are executed when all the conditions of a rule are satisfied.

Link copied to clipboard
val conditions: Output<List<Any>>? = null

A list of conditions that must be matched for the actions to be executed

Link copied to clipboard

If this rule is a match should the rules engine continue running the remaining rules or stop. If not present, defaults to Continue.

Link copied to clipboard
val order: Output<Int>? = null

The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a special rule. It does not require any condition and actions listed in it will always be applied.

Link copied to clipboard
val profileName: Output<String>? = null

Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

Name of the Resource group within the Azure subscription.

Link copied to clipboard
val ruleName: Output<String>? = null

Name of the delivery rule which is unique within the endpoint.

Link copied to clipboard
val ruleSetName: Output<String>? = null

Name of the rule set under the profile.

Functions

Link copied to clipboard
open override fun toJava(): RuleArgs