1. Packages
  2. Cloudflare
  3. API Docs
  4. WebAnalyticsRule
Cloudflare v5.33.1 published on Wednesday, Jun 26, 2024 by Pulumi

cloudflare.WebAnalyticsRule

Explore with Pulumi AI

cloudflare logo
Cloudflare v5.33.1 published on Wednesday, Jun 26, 2024 by Pulumi

    Provides a Cloudflare Web Analytics Rule resource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const example = new cloudflare.WebAnalyticsSite("example", {
        accountId: "f037e56e89293a057740de681ac9abbe",
        zoneTag: "0da42c8d2132a9ddaf714f9e7c920711",
        autoInstall: true,
    });
    const exampleWebAnalyticsRule = new cloudflare.WebAnalyticsRule("example", {
        accountId: "f037e56e89293a057740de681ac9abbe",
        rulesetId: example.rulesetId,
        host: "*",
        paths: ["/excluded"],
        inclusive: false,
        isPaused: false,
    }, {
        dependsOn: [example],
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example = cloudflare.WebAnalyticsSite("example",
        account_id="f037e56e89293a057740de681ac9abbe",
        zone_tag="0da42c8d2132a9ddaf714f9e7c920711",
        auto_install=True)
    example_web_analytics_rule = cloudflare.WebAnalyticsRule("example",
        account_id="f037e56e89293a057740de681ac9abbe",
        ruleset_id=example.ruleset_id,
        host="*",
        paths=["/excluded"],
        inclusive=False,
        is_paused=False,
        opts = pulumi.ResourceOptions(depends_on=[example]))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := cloudflare.NewWebAnalyticsSite(ctx, "example", &cloudflare.WebAnalyticsSiteArgs{
    			AccountId:   pulumi.String("f037e56e89293a057740de681ac9abbe"),
    			ZoneTag:     pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
    			AutoInstall: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cloudflare.NewWebAnalyticsRule(ctx, "example", &cloudflare.WebAnalyticsRuleArgs{
    			AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
    			RulesetId: example.RulesetId,
    			Host:      pulumi.String("*"),
    			Paths: pulumi.StringArray{
    				pulumi.String("/excluded"),
    			},
    			Inclusive: pulumi.Bool(false),
    			IsPaused:  pulumi.Bool(false),
    		}, pulumi.DependsOn([]pulumi.Resource{
    			example,
    		}))
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Cloudflare.WebAnalyticsSite("example", new()
        {
            AccountId = "f037e56e89293a057740de681ac9abbe",
            ZoneTag = "0da42c8d2132a9ddaf714f9e7c920711",
            AutoInstall = true,
        });
    
        var exampleWebAnalyticsRule = new Cloudflare.WebAnalyticsRule("example", new()
        {
            AccountId = "f037e56e89293a057740de681ac9abbe",
            RulesetId = example.RulesetId,
            Host = "*",
            Paths = new[]
            {
                "/excluded",
            },
            Inclusive = false,
            IsPaused = false,
        }, new CustomResourceOptions
        {
            DependsOn =
            {
                example,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.WebAnalyticsSite;
    import com.pulumi.cloudflare.WebAnalyticsSiteArgs;
    import com.pulumi.cloudflare.WebAnalyticsRule;
    import com.pulumi.cloudflare.WebAnalyticsRuleArgs;
    import com.pulumi.resources.CustomResourceOptions;
    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 example = new WebAnalyticsSite("example", WebAnalyticsSiteArgs.builder()
                .accountId("f037e56e89293a057740de681ac9abbe")
                .zoneTag("0da42c8d2132a9ddaf714f9e7c920711")
                .autoInstall(true)
                .build());
    
            var exampleWebAnalyticsRule = new WebAnalyticsRule("exampleWebAnalyticsRule", WebAnalyticsRuleArgs.builder()
                .accountId("f037e56e89293a057740de681ac9abbe")
                .rulesetId(example.rulesetId())
                .host("*")
                .paths("/excluded")
                .inclusive(false)
                .isPaused(false)
                .build(), CustomResourceOptions.builder()
                    .dependsOn(example)
                    .build());
    
        }
    }
    
    resources:
      example:
        type: cloudflare:WebAnalyticsSite
        properties:
          accountId: f037e56e89293a057740de681ac9abbe
          zoneTag: 0da42c8d2132a9ddaf714f9e7c920711
          autoInstall: true
      exampleWebAnalyticsRule:
        type: cloudflare:WebAnalyticsRule
        name: example
        properties:
          accountId: f037e56e89293a057740de681ac9abbe
          rulesetId: ${example.rulesetId}
          host: '*'
          paths:
            - /excluded
          inclusive: false
          isPaused: false
        options:
          dependson:
            - ${example}
    

    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,
                         host: Optional[str] = None,
                         inclusive: Optional[bool] = None,
                         is_paused: Optional[bool] = None,
                         paths: Optional[Sequence[str]] = None,
                         ruleset_id: Optional[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 string
    The unique name of the resource.
    args WebAnalyticsRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args 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 string
    The unique name of the resource.
    args WebAnalyticsRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args WebAnalyticsRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args 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",
        Host = "string",
        Inclusive = false,
        IsPaused = false,
        Paths = new[]
        {
            "string",
        },
        RulesetId = "string",
    });
    
    example, err := cloudflare.NewWebAnalyticsRule(ctx, "webAnalyticsRuleResource", &cloudflare.WebAnalyticsRuleArgs{
    	AccountId: pulumi.String("string"),
    	Host:      pulumi.String("string"),
    	Inclusive: pulumi.Bool(false),
    	IsPaused:  pulumi.Bool(false),
    	Paths: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	RulesetId: pulumi.String("string"),
    })
    
    var webAnalyticsRuleResource = new WebAnalyticsRule("webAnalyticsRuleResource", WebAnalyticsRuleArgs.builder()
        .accountId("string")
        .host("string")
        .inclusive(false)
        .isPaused(false)
        .paths("string")
        .rulesetId("string")
        .build());
    
    web_analytics_rule_resource = cloudflare.WebAnalyticsRule("webAnalyticsRuleResource",
        account_id="string",
        host="string",
        inclusive=False,
        is_paused=False,
        paths=["string"],
        ruleset_id="string")
    
    const webAnalyticsRuleResource = new cloudflare.WebAnalyticsRule("webAnalyticsRuleResource", {
        accountId: "string",
        host: "string",
        inclusive: false,
        isPaused: false,
        paths: ["string"],
        rulesetId: "string",
    });
    
    type: cloudflare:WebAnalyticsRule
    properties:
        accountId: string
        host: string
        inclusive: false
        isPaused: false
        paths:
            - string
        rulesetId: string
    

    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

    The WebAnalyticsRule resource accepts the following input properties:

    AccountId string
    The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    Host string
    The host to apply the rule to.
    Inclusive bool
    Whether the rule includes or excludes the matched traffic from being measured in Web Analytics.
    IsPaused bool
    Whether the rule is paused or not.
    Paths List<string>
    A list of paths to apply the rule to.
    RulesetId string
    The Web Analytics ruleset id. Modifying this attribute will force creation of a new resource.
    AccountId string
    The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    Host string
    The host to apply the rule to.
    Inclusive bool
    Whether the rule includes or excludes the matched traffic from being measured in Web Analytics.
    IsPaused bool
    Whether the rule is paused or not.
    Paths []string
    A list of paths to apply the rule to.
    RulesetId string
    The Web Analytics ruleset id. Modifying this attribute will force creation of a new resource.
    accountId String
    The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    host String
    The host to apply the rule to.
    inclusive Boolean
    Whether the rule includes or excludes the matched traffic from being measured in Web Analytics.
    isPaused Boolean
    Whether the rule is paused or not.
    paths List<String>
    A list of paths to apply the rule to.
    rulesetId String
    The Web Analytics ruleset id. Modifying this attribute will force creation of a new resource.
    accountId string
    The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    host string
    The host to apply the rule to.
    inclusive boolean
    Whether the rule includes or excludes the matched traffic from being measured in Web Analytics.
    isPaused boolean
    Whether the rule is paused or not.
    paths string[]
    A list of paths to apply the rule to.
    rulesetId string
    The Web Analytics ruleset id. Modifying this attribute will force creation of a new resource.
    account_id str
    The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    host str
    The host to apply the rule to.
    inclusive bool
    Whether the rule includes or excludes the matched traffic from being measured in Web Analytics.
    is_paused bool
    Whether the rule is paused or not.
    paths Sequence[str]
    A list of paths to apply the rule to.
    ruleset_id str
    The Web Analytics ruleset id. Modifying this attribute will force creation of a new resource.
    accountId String
    The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    host String
    The host to apply the rule to.
    inclusive Boolean
    Whether the rule includes or excludes the matched traffic from being measured in Web Analytics.
    isPaused Boolean
    Whether the rule is paused or not.
    paths List<String>
    A list of paths to apply the rule to.
    rulesetId String
    The Web Analytics ruleset id. Modifying this attribute will force creation of a new resource.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    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,
            host: Optional[str] = None,
            inclusive: Optional[bool] = None,
            is_paused: Optional[bool] = None,
            paths: Optional[Sequence[str]] = 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)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    Host string
    The host to apply the rule to.
    Inclusive bool
    Whether the rule includes or excludes the matched traffic from being measured in Web Analytics.
    IsPaused bool
    Whether the rule is paused or not.
    Paths List<string>
    A list of paths to apply the rule to.
    RulesetId string
    The Web Analytics ruleset id. Modifying this attribute will force creation of a new resource.
    AccountId string
    The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    Host string
    The host to apply the rule to.
    Inclusive bool
    Whether the rule includes or excludes the matched traffic from being measured in Web Analytics.
    IsPaused bool
    Whether the rule is paused or not.
    Paths []string
    A list of paths to apply the rule to.
    RulesetId string
    The Web Analytics ruleset id. Modifying this attribute will force creation of a new resource.
    accountId String
    The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    host String
    The host to apply the rule to.
    inclusive Boolean
    Whether the rule includes or excludes the matched traffic from being measured in Web Analytics.
    isPaused Boolean
    Whether the rule is paused or not.
    paths List<String>
    A list of paths to apply the rule to.
    rulesetId String
    The Web Analytics ruleset id. Modifying this attribute will force creation of a new resource.
    accountId string
    The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    host string
    The host to apply the rule to.
    inclusive boolean
    Whether the rule includes or excludes the matched traffic from being measured in Web Analytics.
    isPaused boolean
    Whether the rule is paused or not.
    paths string[]
    A list of paths to apply the rule to.
    rulesetId string
    The Web Analytics ruleset id. Modifying this attribute will force creation of a new resource.
    account_id str
    The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    host str
    The host to apply the rule to.
    inclusive bool
    Whether the rule includes or excludes the matched traffic from being measured in Web Analytics.
    is_paused bool
    Whether the rule is paused or not.
    paths Sequence[str]
    A list of paths to apply the rule to.
    ruleset_id str
    The Web Analytics ruleset id. Modifying this attribute will force creation of a new resource.
    accountId String
    The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    host String
    The host to apply the rule to.
    inclusive Boolean
    Whether the rule includes or excludes the matched traffic from being measured in Web Analytics.
    isPaused Boolean
    Whether the rule is paused or not.
    paths List<String>
    A list of paths to apply the rule to.
    rulesetId String
    The Web Analytics ruleset id. Modifying this attribute will force creation of a new resource.

    Import

    $ pulumi import cloudflare:index/webAnalyticsRule:WebAnalyticsRule example <account_id>/<ruleset_id>/<rule_id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Cloudflare pulumi/pulumi-cloudflare
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the cloudflare Terraform Provider.
    cloudflare logo
    Cloudflare v5.33.1 published on Wednesday, Jun 26, 2024 by Pulumi