1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. WebAnalyticsSite
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi

cloudflare.WebAnalyticsSite

Explore with Pulumi AI

cloudflare logo
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const exampleWebAnalyticsSite = new cloudflare.WebAnalyticsSite("example_web_analytics_site", {
        accountId: "023e105f4ecef8ad9ca31a8372d0c353",
        autoInstall: true,
        host: "example.com",
        zoneTag: "023e105f4ecef8ad9ca31a8372d0c353",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_web_analytics_site = cloudflare.WebAnalyticsSite("example_web_analytics_site",
        account_id="023e105f4ecef8ad9ca31a8372d0c353",
        auto_install=True,
        host="example.com",
        zone_tag="023e105f4ecef8ad9ca31a8372d0c353")
    
    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.NewWebAnalyticsSite(ctx, "example_web_analytics_site", &cloudflare.WebAnalyticsSiteArgs{
    			AccountId:   pulumi.String("023e105f4ecef8ad9ca31a8372d0c353"),
    			AutoInstall: pulumi.Bool(true),
    			Host:        pulumi.String("example.com"),
    			ZoneTag:     pulumi.String("023e105f4ecef8ad9ca31a8372d0c353"),
    		})
    		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 exampleWebAnalyticsSite = new Cloudflare.WebAnalyticsSite("example_web_analytics_site", new()
        {
            AccountId = "023e105f4ecef8ad9ca31a8372d0c353",
            AutoInstall = true,
            Host = "example.com",
            ZoneTag = "023e105f4ecef8ad9ca31a8372d0c353",
        });
    
    });
    
    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 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 exampleWebAnalyticsSite = new WebAnalyticsSite("exampleWebAnalyticsSite", WebAnalyticsSiteArgs.builder()
                .accountId("023e105f4ecef8ad9ca31a8372d0c353")
                .autoInstall(true)
                .host("example.com")
                .zoneTag("023e105f4ecef8ad9ca31a8372d0c353")
                .build());
    
        }
    }
    
    resources:
      exampleWebAnalyticsSite:
        type: cloudflare:WebAnalyticsSite
        name: example_web_analytics_site
        properties:
          accountId: 023e105f4ecef8ad9ca31a8372d0c353
          autoInstall: true
          host: example.com
          zoneTag: 023e105f4ecef8ad9ca31a8372d0c353
    

    Create WebAnalyticsSite Resource

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

    Constructor syntax

    new WebAnalyticsSite(name: string, args: WebAnalyticsSiteArgs, opts?: CustomResourceOptions);
    @overload
    def WebAnalyticsSite(resource_name: str,
                         args: WebAnalyticsSiteArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def WebAnalyticsSite(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         account_id: Optional[str] = None,
                         auto_install: Optional[bool] = None,
                         enabled: Optional[bool] = None,
                         host: Optional[str] = None,
                         lite: Optional[bool] = None,
                         zone_tag: Optional[str] = None)
    func NewWebAnalyticsSite(ctx *Context, name string, args WebAnalyticsSiteArgs, opts ...ResourceOption) (*WebAnalyticsSite, error)
    public WebAnalyticsSite(string name, WebAnalyticsSiteArgs args, CustomResourceOptions? opts = null)
    public WebAnalyticsSite(String name, WebAnalyticsSiteArgs args)
    public WebAnalyticsSite(String name, WebAnalyticsSiteArgs args, CustomResourceOptions options)
    
    type: cloudflare:WebAnalyticsSite
    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 WebAnalyticsSiteArgs
    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 WebAnalyticsSiteArgs
    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 WebAnalyticsSiteArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args WebAnalyticsSiteArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args WebAnalyticsSiteArgs
    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 webAnalyticsSiteResource = new Cloudflare.WebAnalyticsSite("webAnalyticsSiteResource", new()
    {
        AccountId = "string",
        AutoInstall = false,
        Enabled = false,
        Host = "string",
        Lite = false,
        ZoneTag = "string",
    });
    
    example, err := cloudflare.NewWebAnalyticsSite(ctx, "webAnalyticsSiteResource", &cloudflare.WebAnalyticsSiteArgs{
    	AccountId:   pulumi.String("string"),
    	AutoInstall: pulumi.Bool(false),
    	Enabled:     pulumi.Bool(false),
    	Host:        pulumi.String("string"),
    	Lite:        pulumi.Bool(false),
    	ZoneTag:     pulumi.String("string"),
    })
    
    var webAnalyticsSiteResource = new WebAnalyticsSite("webAnalyticsSiteResource", WebAnalyticsSiteArgs.builder()
        .accountId("string")
        .autoInstall(false)
        .enabled(false)
        .host("string")
        .lite(false)
        .zoneTag("string")
        .build());
    
    web_analytics_site_resource = cloudflare.WebAnalyticsSite("webAnalyticsSiteResource",
        account_id="string",
        auto_install=False,
        enabled=False,
        host="string",
        lite=False,
        zone_tag="string")
    
    const webAnalyticsSiteResource = new cloudflare.WebAnalyticsSite("webAnalyticsSiteResource", {
        accountId: "string",
        autoInstall: false,
        enabled: false,
        host: "string",
        lite: false,
        zoneTag: "string",
    });
    
    type: cloudflare:WebAnalyticsSite
    properties:
        accountId: string
        autoInstall: false
        enabled: false
        host: string
        lite: false
        zoneTag: string
    

    WebAnalyticsSite 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 WebAnalyticsSite resource accepts the following input properties:

    AccountId string
    Identifier
    AutoInstall bool
    If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.
    Enabled bool
    Enables or disables RUM. This option can be used only when auto_install is set to true.
    Host string
    The hostname to use for gray-clouded sites.
    Lite bool
    If enabled, the JavaScript snippet will not be injected for visitors from the EU.
    ZoneTag string
    The zone identifier.
    AccountId string
    Identifier
    AutoInstall bool
    If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.
    Enabled bool
    Enables or disables RUM. This option can be used only when auto_install is set to true.
    Host string
    The hostname to use for gray-clouded sites.
    Lite bool
    If enabled, the JavaScript snippet will not be injected for visitors from the EU.
    ZoneTag string
    The zone identifier.
    accountId String
    Identifier
    autoInstall Boolean
    If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.
    enabled Boolean
    Enables or disables RUM. This option can be used only when auto_install is set to true.
    host String
    The hostname to use for gray-clouded sites.
    lite Boolean
    If enabled, the JavaScript snippet will not be injected for visitors from the EU.
    zoneTag String
    The zone identifier.
    accountId string
    Identifier
    autoInstall boolean
    If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.
    enabled boolean
    Enables or disables RUM. This option can be used only when auto_install is set to true.
    host string
    The hostname to use for gray-clouded sites.
    lite boolean
    If enabled, the JavaScript snippet will not be injected for visitors from the EU.
    zoneTag string
    The zone identifier.
    account_id str
    Identifier
    auto_install bool
    If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.
    enabled bool
    Enables or disables RUM. This option can be used only when auto_install is set to true.
    host str
    The hostname to use for gray-clouded sites.
    lite bool
    If enabled, the JavaScript snippet will not be injected for visitors from the EU.
    zone_tag str
    The zone identifier.
    accountId String
    Identifier
    autoInstall Boolean
    If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.
    enabled Boolean
    Enables or disables RUM. This option can be used only when auto_install is set to true.
    host String
    The hostname to use for gray-clouded sites.
    lite Boolean
    If enabled, the JavaScript snippet will not be injected for visitors from the EU.
    zoneTag String
    The zone identifier.

    Outputs

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

    Created string
    Id string
    The provider-assigned unique ID for this managed resource.
    Rules List<WebAnalyticsSiteRule>
    A list of rules.
    Ruleset WebAnalyticsSiteRuleset
    SiteTag string
    The Web Analytics site identifier.
    SiteToken string
    The Web Analytics site token.
    Snippet string
    Encoded JavaScript snippet.
    Created string
    Id string
    The provider-assigned unique ID for this managed resource.
    Rules []WebAnalyticsSiteRule
    A list of rules.
    Ruleset WebAnalyticsSiteRuleset
    SiteTag string
    The Web Analytics site identifier.
    SiteToken string
    The Web Analytics site token.
    Snippet string
    Encoded JavaScript snippet.
    created String
    id String
    The provider-assigned unique ID for this managed resource.
    rules List<WebAnalyticsSiteRule>
    A list of rules.
    ruleset WebAnalyticsSiteRuleset
    siteTag String
    The Web Analytics site identifier.
    siteToken String
    The Web Analytics site token.
    snippet String
    Encoded JavaScript snippet.
    created string
    id string
    The provider-assigned unique ID for this managed resource.
    rules WebAnalyticsSiteRule[]
    A list of rules.
    ruleset WebAnalyticsSiteRuleset
    siteTag string
    The Web Analytics site identifier.
    siteToken string
    The Web Analytics site token.
    snippet string
    Encoded JavaScript snippet.
    created str
    id str
    The provider-assigned unique ID for this managed resource.
    rules Sequence[WebAnalyticsSiteRule]
    A list of rules.
    ruleset WebAnalyticsSiteRuleset
    site_tag str
    The Web Analytics site identifier.
    site_token str
    The Web Analytics site token.
    snippet str
    Encoded JavaScript snippet.
    created String
    id String
    The provider-assigned unique ID for this managed resource.
    rules List<Property Map>
    A list of rules.
    ruleset Property Map
    siteTag String
    The Web Analytics site identifier.
    siteToken String
    The Web Analytics site token.
    snippet String
    Encoded JavaScript snippet.

    Look up Existing WebAnalyticsSite Resource

    Get an existing WebAnalyticsSite 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?: WebAnalyticsSiteState, opts?: CustomResourceOptions): WebAnalyticsSite
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_id: Optional[str] = None,
            auto_install: Optional[bool] = None,
            created: Optional[str] = None,
            enabled: Optional[bool] = None,
            host: Optional[str] = None,
            lite: Optional[bool] = None,
            rules: Optional[Sequence[WebAnalyticsSiteRuleArgs]] = None,
            ruleset: Optional[WebAnalyticsSiteRulesetArgs] = None,
            site_tag: Optional[str] = None,
            site_token: Optional[str] = None,
            snippet: Optional[str] = None,
            zone_tag: Optional[str] = None) -> WebAnalyticsSite
    func GetWebAnalyticsSite(ctx *Context, name string, id IDInput, state *WebAnalyticsSiteState, opts ...ResourceOption) (*WebAnalyticsSite, error)
    public static WebAnalyticsSite Get(string name, Input<string> id, WebAnalyticsSiteState? state, CustomResourceOptions? opts = null)
    public static WebAnalyticsSite get(String name, Output<String> id, WebAnalyticsSiteState state, CustomResourceOptions options)
    resources:  _:    type: cloudflare:WebAnalyticsSite    get:      id: ${id}
    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
    Identifier
    AutoInstall bool
    If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.
    Created string
    Enabled bool
    Enables or disables RUM. This option can be used only when auto_install is set to true.
    Host string
    The hostname to use for gray-clouded sites.
    Lite bool
    If enabled, the JavaScript snippet will not be injected for visitors from the EU.
    Rules List<WebAnalyticsSiteRule>
    A list of rules.
    Ruleset WebAnalyticsSiteRuleset
    SiteTag string
    The Web Analytics site identifier.
    SiteToken string
    The Web Analytics site token.
    Snippet string
    Encoded JavaScript snippet.
    ZoneTag string
    The zone identifier.
    AccountId string
    Identifier
    AutoInstall bool
    If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.
    Created string
    Enabled bool
    Enables or disables RUM. This option can be used only when auto_install is set to true.
    Host string
    The hostname to use for gray-clouded sites.
    Lite bool
    If enabled, the JavaScript snippet will not be injected for visitors from the EU.
    Rules []WebAnalyticsSiteRuleArgs
    A list of rules.
    Ruleset WebAnalyticsSiteRulesetArgs
    SiteTag string
    The Web Analytics site identifier.
    SiteToken string
    The Web Analytics site token.
    Snippet string
    Encoded JavaScript snippet.
    ZoneTag string
    The zone identifier.
    accountId String
    Identifier
    autoInstall Boolean
    If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.
    created String
    enabled Boolean
    Enables or disables RUM. This option can be used only when auto_install is set to true.
    host String
    The hostname to use for gray-clouded sites.
    lite Boolean
    If enabled, the JavaScript snippet will not be injected for visitors from the EU.
    rules List<WebAnalyticsSiteRule>
    A list of rules.
    ruleset WebAnalyticsSiteRuleset
    siteTag String
    The Web Analytics site identifier.
    siteToken String
    The Web Analytics site token.
    snippet String
    Encoded JavaScript snippet.
    zoneTag String
    The zone identifier.
    accountId string
    Identifier
    autoInstall boolean
    If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.
    created string
    enabled boolean
    Enables or disables RUM. This option can be used only when auto_install is set to true.
    host string
    The hostname to use for gray-clouded sites.
    lite boolean
    If enabled, the JavaScript snippet will not be injected for visitors from the EU.
    rules WebAnalyticsSiteRule[]
    A list of rules.
    ruleset WebAnalyticsSiteRuleset
    siteTag string
    The Web Analytics site identifier.
    siteToken string
    The Web Analytics site token.
    snippet string
    Encoded JavaScript snippet.
    zoneTag string
    The zone identifier.
    account_id str
    Identifier
    auto_install bool
    If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.
    created str
    enabled bool
    Enables or disables RUM. This option can be used only when auto_install is set to true.
    host str
    The hostname to use for gray-clouded sites.
    lite bool
    If enabled, the JavaScript snippet will not be injected for visitors from the EU.
    rules Sequence[WebAnalyticsSiteRuleArgs]
    A list of rules.
    ruleset WebAnalyticsSiteRulesetArgs
    site_tag str
    The Web Analytics site identifier.
    site_token str
    The Web Analytics site token.
    snippet str
    Encoded JavaScript snippet.
    zone_tag str
    The zone identifier.
    accountId String
    Identifier
    autoInstall Boolean
    If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.
    created String
    enabled Boolean
    Enables or disables RUM. This option can be used only when auto_install is set to true.
    host String
    The hostname to use for gray-clouded sites.
    lite Boolean
    If enabled, the JavaScript snippet will not be injected for visitors from the EU.
    rules List<Property Map>
    A list of rules.
    ruleset Property Map
    siteTag String
    The Web Analytics site identifier.
    siteToken String
    The Web Analytics site token.
    snippet String
    Encoded JavaScript snippet.
    zoneTag String
    The zone identifier.

    Supporting Types

    WebAnalyticsSiteRule, WebAnalyticsSiteRuleArgs

    Created string
    Host string
    The hostname the rule will be applied to.
    Id string
    The Web Analytics rule identifier.
    Inclusive bool
    Whether the rule includes or excludes traffic from being measured.
    IsPaused bool
    Whether the rule is paused or not.
    Paths List<string>
    The paths the rule will be applied to.
    Priority double
    Created string
    Host string
    The hostname the rule will be applied to.
    Id string
    The Web Analytics rule identifier.
    Inclusive bool
    Whether the rule includes or excludes traffic from being measured.
    IsPaused bool
    Whether the rule is paused or not.
    Paths []string
    The paths the rule will be applied to.
    Priority float64
    created String
    host String
    The hostname the rule will be applied to.
    id String
    The Web Analytics rule identifier.
    inclusive Boolean
    Whether the rule includes or excludes traffic from being measured.
    isPaused Boolean
    Whether the rule is paused or not.
    paths List<String>
    The paths the rule will be applied to.
    priority Double
    created string
    host string
    The hostname the rule will be applied to.
    id string
    The Web Analytics rule identifier.
    inclusive boolean
    Whether the rule includes or excludes traffic from being measured.
    isPaused boolean
    Whether the rule is paused or not.
    paths string[]
    The paths the rule will be applied to.
    priority number
    created str
    host str
    The hostname the rule will be applied to.
    id str
    The Web Analytics rule identifier.
    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]
    The paths the rule will be applied to.
    priority float
    created String
    host String
    The hostname the rule will be applied to.
    id String
    The Web Analytics rule identifier.
    inclusive Boolean
    Whether the rule includes or excludes traffic from being measured.
    isPaused Boolean
    Whether the rule is paused or not.
    paths List<String>
    The paths the rule will be applied to.
    priority Number

    WebAnalyticsSiteRuleset, WebAnalyticsSiteRulesetArgs

    Enabled bool
    Whether the ruleset is enabled.
    Id string
    The Web Analytics ruleset identifier.
    ZoneName string
    ZoneTag string
    The zone identifier.
    Enabled bool
    Whether the ruleset is enabled.
    Id string
    The Web Analytics ruleset identifier.
    ZoneName string
    ZoneTag string
    The zone identifier.
    enabled Boolean
    Whether the ruleset is enabled.
    id String
    The Web Analytics ruleset identifier.
    zoneName String
    zoneTag String
    The zone identifier.
    enabled boolean
    Whether the ruleset is enabled.
    id string
    The Web Analytics ruleset identifier.
    zoneName string
    zoneTag string
    The zone identifier.
    enabled bool
    Whether the ruleset is enabled.
    id str
    The Web Analytics ruleset identifier.
    zone_name str
    zone_tag str
    The zone identifier.
    enabled Boolean
    Whether the ruleset is enabled.
    id String
    The Web Analytics ruleset identifier.
    zoneName String
    zoneTag String
    The zone identifier.

    Import

    $ pulumi import cloudflare:index/webAnalyticsSite:WebAnalyticsSite example '<account_id>/<site_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 v6.1.2 published on Monday, Apr 28, 2025 by Pulumi