Rule Args
Friendly Rules name mapping to the any Rules or secret related information. Uses Azure REST API version 2024-09-01. In version 2.x of the Azure Native provider, it used API version 2023-05-01. Other available API versions: 2023-05-01, 2023-07-01-preview, 2024-02-01, 2024-05-01-preview, 2024-06-01-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native cdn [ApiVersion]
. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.
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[]
{
AzureNative.Cdn.RequestMethodMatchValue.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: []cdn.RequestMethodMatchValue{
cdn.RequestMethodMatchValueGET,
},
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
Properties
A list of conditions that must be matched for the actions to be executed
If this rule is a match should the rules engine continue running the remaining rules or stop. If not present, defaults to Continue.
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.
Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.
Name of the Resource group within the Azure subscription.
Name of the rule set under the profile.