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. API Version: 2020-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 = "Overwrite",
HeaderName = "X-CDN",
OdataType = "#Microsoft.Azure.Cdn.Models.DeliveryRuleHeaderActionParameters",
Value = "MSFT",
},
},
},
Conditions = new[]
{
new AzureNative.Cdn.Inputs.DeliveryRuleRequestMethodConditionArgs
{
Name = "RequestMethod",
Parameters = new AzureNative.Cdn.Inputs.RequestMethodMatchConditionParametersArgs
{
MatchValues = new[]
{
"GET",
},
NegateCondition = false,
OdataType = "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestMethodConditionParameters",
Operator = "Equal",
},
},
},
Order = 1,
ProfileName = "profile1",
ResourceGroupName = "RG",
RuleName = "rule1",
RuleSetName = "ruleSet1",
});
});
package main
import (
cdn "github.com/pulumi/pulumi-azure-native-sdk/cdn"
"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.AnyArray{
cdn.DeliveryRuleResponseHeaderAction{
Name: "ModifyResponseHeader",
Parameters: cdn.HeaderActionParameters{
HeaderAction: "Overwrite",
HeaderName: "X-CDN",
OdataType: "#Microsoft.Azure.Cdn.Models.DeliveryRuleHeaderActionParameters",
Value: "MSFT",
},
},
},
Conditions: pulumi.AnyArray{
cdn.DeliveryRuleRequestMethodCondition{
Name: "RequestMethod",
Parameters: cdn.RequestMethodMatchConditionParameters{
MatchValues: []string{
"GET",
},
NegateCondition: false,
OdataType: "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestMethodConditionParameters",
Operator: "Equal",
},
},
},
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(Map.ofEntries(
Map.entry("name", "ModifyResponseHeader"),
Map.entry("parameters", Map.ofEntries(
Map.entry("headerAction", "Overwrite"),
Map.entry("headerName", "X-CDN"),
Map.entry("odataType", "#Microsoft.Azure.Cdn.Models.DeliveryRuleHeaderActionParameters"),
Map.entry("value", "MSFT")
))
))
.conditions(Map.ofEntries(
Map.entry("name", "RequestMethod"),
Map.entry("parameters", Map.ofEntries(
Map.entry("matchValues", "GET"),
Map.entry("negateCondition", false),
Map.entry("odataType", "#Microsoft.Azure.Cdn.Models.DeliveryRuleRequestMethodConditionParameters"),
Map.entry("operator", "Equal")
))
))
.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/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/ruleSets/ruleSet1/rules/rule1

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 CDN 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