1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. WebAnalyticsRule
Cloudflare v6.0.0 published on Monday, Apr 14, 2025 by Pulumi

cloudflare.WebAnalyticsRule

Explore with Pulumi AI

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";

const exampleWebAnalyticsRule = new cloudflare.WebAnalyticsRule("example_web_analytics_rule", {
    accountId: "023e105f4ecef8ad9ca31a8372d0c353",
    rulesetId: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
    host: "example.com",
    inclusive: true,
    isPaused: false,
    paths: ["*"],
});
Copy
import pulumi
import pulumi_cloudflare as cloudflare

example_web_analytics_rule = cloudflare.WebAnalyticsRule("example_web_analytics_rule",
    account_id="023e105f4ecef8ad9ca31a8372d0c353",
    ruleset_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
    host="example.com",
    inclusive=True,
    is_paused=False,
    paths=["*"])
Copy
package main

import (
	"github.com/pulumi/pulumi-cloudflare/sdk/v6/go/cloudflare"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudflare.NewWebAnalyticsRule(ctx, "example_web_analytics_rule", &cloudflare.WebAnalyticsRuleArgs{
			AccountId: pulumi.String("023e105f4ecef8ad9ca31a8372d0c353"),
			RulesetId: pulumi.String("f174e90a-fafe-4643-bbbc-4a0ed4fc8415"),
			Host:      pulumi.String("example.com"),
			Inclusive: pulumi.Bool(true),
			IsPaused:  pulumi.Bool(false),
			Paths: pulumi.StringArray{
				pulumi.String("*"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;

return await Deployment.RunAsync(() => 
{
    var exampleWebAnalyticsRule = new Cloudflare.WebAnalyticsRule("example_web_analytics_rule", new()
    {
        AccountId = "023e105f4ecef8ad9ca31a8372d0c353",
        RulesetId = "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
        Host = "example.com",
        Inclusive = true,
        IsPaused = false,
        Paths = new[]
        {
            "*",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.WebAnalyticsRule;
import com.pulumi.cloudflare.WebAnalyticsRuleArgs;
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 exampleWebAnalyticsRule = new WebAnalyticsRule("exampleWebAnalyticsRule", WebAnalyticsRuleArgs.builder()
            .accountId("023e105f4ecef8ad9ca31a8372d0c353")
            .rulesetId("f174e90a-fafe-4643-bbbc-4a0ed4fc8415")
            .host("example.com")
            .inclusive(true)
            .isPaused(false)
            .paths("*")
            .build());

    }
}
Copy
resources:
  exampleWebAnalyticsRule:
    type: cloudflare:WebAnalyticsRule
    name: example_web_analytics_rule
    properties:
      accountId: 023e105f4ecef8ad9ca31a8372d0c353
      rulesetId: f174e90a-fafe-4643-bbbc-4a0ed4fc8415
      host: example.com
      inclusive: true
      isPaused: false
      paths:
        - '*'
Copy

Create WebAnalyticsRule Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new WebAnalyticsRule(name: string, args: WebAnalyticsRuleArgs, opts?: CustomResourceOptions);
@overload
def WebAnalyticsRule(resource_name: str,
                     args: WebAnalyticsRuleArgs,
                     opts: Optional[ResourceOptions] = None)

@overload
def WebAnalyticsRule(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     account_id: Optional[str] = None,
                     ruleset_id: Optional[str] = None,
                     host: Optional[str] = None,
                     inclusive: Optional[bool] = None,
                     is_paused: Optional[bool] = None,
                     paths: Optional[Sequence[str]] = None)
func NewWebAnalyticsRule(ctx *Context, name string, args WebAnalyticsRuleArgs, opts ...ResourceOption) (*WebAnalyticsRule, error)
public WebAnalyticsRule(string name, WebAnalyticsRuleArgs args, CustomResourceOptions? opts = null)
public WebAnalyticsRule(String name, WebAnalyticsRuleArgs args)
public WebAnalyticsRule(String name, WebAnalyticsRuleArgs args, CustomResourceOptions options)
type: cloudflare:WebAnalyticsRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. WebAnalyticsRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. WebAnalyticsRuleArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. WebAnalyticsRuleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. WebAnalyticsRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. WebAnalyticsRuleArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var webAnalyticsRuleResource = new Cloudflare.WebAnalyticsRule("webAnalyticsRuleResource", new()
{
    AccountId = "string",
    RulesetId = "string",
    Host = "string",
    Inclusive = false,
    IsPaused = false,
    Paths = new[]
    {
        "string",
    },
});
Copy
example, err := cloudflare.NewWebAnalyticsRule(ctx, "webAnalyticsRuleResource", &cloudflare.WebAnalyticsRuleArgs{
	AccountId: pulumi.String("string"),
	RulesetId: pulumi.String("string"),
	Host:      pulumi.String("string"),
	Inclusive: pulumi.Bool(false),
	IsPaused:  pulumi.Bool(false),
	Paths: pulumi.StringArray{
		pulumi.String("string"),
	},
})
Copy
var webAnalyticsRuleResource = new WebAnalyticsRule("webAnalyticsRuleResource", WebAnalyticsRuleArgs.builder()
    .accountId("string")
    .rulesetId("string")
    .host("string")
    .inclusive(false)
    .isPaused(false)
    .paths("string")
    .build());
Copy
web_analytics_rule_resource = cloudflare.WebAnalyticsRule("webAnalyticsRuleResource",
    account_id="string",
    ruleset_id="string",
    host="string",
    inclusive=False,
    is_paused=False,
    paths=["string"])
Copy
const webAnalyticsRuleResource = new cloudflare.WebAnalyticsRule("webAnalyticsRuleResource", {
    accountId: "string",
    rulesetId: "string",
    host: "string",
    inclusive: false,
    isPaused: false,
    paths: ["string"],
});
Copy
type: cloudflare:WebAnalyticsRule
properties:
    accountId: string
    host: string
    inclusive: false
    isPaused: false
    paths:
        - string
    rulesetId: string
Copy

WebAnalyticsRule Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The WebAnalyticsRule resource accepts the following input properties:

AccountId This property is required. string
Identifier
RulesetId This property is required. string
The Web Analytics ruleset identifier.
Host string
Inclusive bool
Whether the rule includes or excludes traffic from being measured.
IsPaused bool
Whether the rule is paused or not.
Paths List<string>
AccountId This property is required. string
Identifier
RulesetId This property is required. string
The Web Analytics ruleset identifier.
Host string
Inclusive bool
Whether the rule includes or excludes traffic from being measured.
IsPaused bool
Whether the rule is paused or not.
Paths []string
accountId This property is required. String
Identifier
rulesetId This property is required. String
The Web Analytics ruleset identifier.
host String
inclusive Boolean
Whether the rule includes or excludes traffic from being measured.
isPaused Boolean
Whether the rule is paused or not.
paths List<String>
accountId This property is required. string
Identifier
rulesetId This property is required. string
The Web Analytics ruleset identifier.
host string
inclusive boolean
Whether the rule includes or excludes traffic from being measured.
isPaused boolean
Whether the rule is paused or not.
paths string[]
account_id This property is required. str
Identifier
ruleset_id This property is required. str
The Web Analytics ruleset identifier.
host str
inclusive bool
Whether the rule includes or excludes traffic from being measured.
is_paused bool
Whether the rule is paused or not.
paths Sequence[str]
accountId This property is required. String
Identifier
rulesetId This property is required. String
The Web Analytics ruleset identifier.
host String
inclusive Boolean
Whether the rule includes or excludes traffic from being measured.
isPaused Boolean
Whether the rule is paused or not.
paths List<String>

Outputs

All input properties are implicitly available as output properties. Additionally, the WebAnalyticsRule resource produces the following output properties:

Created string
Id string
The provider-assigned unique ID for this managed resource.
Priority double
Created string
Id string
The provider-assigned unique ID for this managed resource.
Priority float64
created String
id String
The provider-assigned unique ID for this managed resource.
priority Double
created string
id string
The provider-assigned unique ID for this managed resource.
priority number
created str
id str
The provider-assigned unique ID for this managed resource.
priority float
created String
id String
The provider-assigned unique ID for this managed resource.
priority Number

Look up Existing WebAnalyticsRule Resource

Get an existing WebAnalyticsRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: WebAnalyticsRuleState, opts?: CustomResourceOptions): WebAnalyticsRule
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[str] = None,
        created: Optional[str] = None,
        host: Optional[str] = None,
        inclusive: Optional[bool] = None,
        is_paused: Optional[bool] = None,
        paths: Optional[Sequence[str]] = None,
        priority: Optional[float] = None,
        ruleset_id: Optional[str] = None) -> WebAnalyticsRule
func GetWebAnalyticsRule(ctx *Context, name string, id IDInput, state *WebAnalyticsRuleState, opts ...ResourceOption) (*WebAnalyticsRule, error)
public static WebAnalyticsRule Get(string name, Input<string> id, WebAnalyticsRuleState? state, CustomResourceOptions? opts = null)
public static WebAnalyticsRule get(String name, Output<String> id, WebAnalyticsRuleState state, CustomResourceOptions options)
resources:  _:    type: cloudflare:WebAnalyticsRule    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AccountId string
Identifier
Created string
Host string
Inclusive bool
Whether the rule includes or excludes traffic from being measured.
IsPaused bool
Whether the rule is paused or not.
Paths List<string>
Priority double
RulesetId string
The Web Analytics ruleset identifier.
AccountId string
Identifier
Created string
Host string
Inclusive bool
Whether the rule includes or excludes traffic from being measured.
IsPaused bool
Whether the rule is paused or not.
Paths []string
Priority float64
RulesetId string
The Web Analytics ruleset identifier.
accountId String
Identifier
created String
host String
inclusive Boolean
Whether the rule includes or excludes traffic from being measured.
isPaused Boolean
Whether the rule is paused or not.
paths List<String>
priority Double
rulesetId String
The Web Analytics ruleset identifier.
accountId string
Identifier
created string
host string
inclusive boolean
Whether the rule includes or excludes traffic from being measured.
isPaused boolean
Whether the rule is paused or not.
paths string[]
priority number
rulesetId string
The Web Analytics ruleset identifier.
account_id str
Identifier
created str
host str
inclusive bool
Whether the rule includes or excludes traffic from being measured.
is_paused bool
Whether the rule is paused or not.
paths Sequence[str]
priority float
ruleset_id str
The Web Analytics ruleset identifier.
accountId String
Identifier
created String
host String
inclusive Boolean
Whether the rule includes or excludes traffic from being measured.
isPaused Boolean
Whether the rule is paused or not.
paths List<String>
priority Number
rulesetId String
The Web Analytics ruleset identifier.

Package Details

Repository
Cloudflare pulumi/pulumi-cloudflare
License
Apache-2.0
Notes
This Pulumi package is based on the cloudflare Terraform Provider.