Class PageRule
Provides a Cloudflare page rule resource.
Example Usage
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
class MyStack : Stack
{
public MyStack()
{
// Add a page rule to the domain
var foobar = new Cloudflare.PageRule("foobar", new Cloudflare.PageRuleArgs
{
ZoneId = @var.Cloudflare_zone_id,
Target = $"sub.{@var.Cloudflare_zone}/page",
Priority = 1,
Actions = new Cloudflare.Inputs.PageRuleActionsArgs
{
Ssl = "flexible",
EmailObfuscation = "on",
Minify =
{
{
{ "html", "off" },
{ "css", "on" },
{ "js", "on" },
},
},
},
});
}
}
Inherited Members
Namespace: Pulumi.Cloudflare
Assembly: Pulumi.Cloudflare.dll
Syntax
public class PageRule : CustomResource
Constructors
View SourcePageRule(String, PageRuleArgs, CustomResourceOptions)
Create a PageRule resource with the given unique name, arguments, and options.
Declaration
public PageRule(string name, PageRuleArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| PageRuleArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceActions
The actions taken by the page rule, options given below.
Declaration
public Output<PageRuleActions> Actions { get; }
Property Value
| Type | Description |
|---|---|
| Output<PageRuleActions> |
Priority
The priority of the page rule among others for this target, the higher the number the higher the priority as per API documentation.
Declaration
public Output<int?> Priority { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
Status
Whether the page rule is active or disabled.
Declaration
public Output<string> Status { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Target
The URL pattern to target with the page rule.
Declaration
public Output<string> Target { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ZoneId
The DNS zone ID to which the page rule should be added.
Declaration
public Output<string> ZoneId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, PageRuleState, CustomResourceOptions)
Get an existing PageRule resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static PageRule Get(string name, Input<string> id, PageRuleState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| PageRuleState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| PageRule |