Rule
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",
});
});
Content copied to clipboard
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
})
}
Content copied to clipboard
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());
}
}
Content copied to clipboard
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
Content copied to clipboard
Properties
Link copied to clipboard
A list of conditions that must be matched for the actions to be executed
Link copied to clipboard
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
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
Provisioning status
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Read only system data