1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. WebAnalyticsSite
Cloudflare v5.43.0 published on Wednesday, Nov 13, 2024 by Pulumi

cloudflare.WebAnalyticsSite

Explore with Pulumi AI

cloudflare logo
Cloudflare v5.43.0 published on Wednesday, Nov 13, 2024 by Pulumi

    Provides a Cloudflare Web Analytics Site 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,
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example = cloudflare.WebAnalyticsSite("example",
        account_id="f037e56e89293a057740de681ac9abbe",
        zone_tag="0da42c8d2132a9ddaf714f9e7c920711",
        auto_install=True)
    
    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 {
    		_, err := cloudflare.NewWebAnalyticsSite(ctx, "example", &cloudflare.WebAnalyticsSiteArgs{
    			AccountId:   pulumi.String("f037e56e89293a057740de681ac9abbe"),
    			ZoneTag:     pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
    			AutoInstall: pulumi.Bool(true),
    		})
    		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,
        });
    
    });
    
    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 example = new WebAnalyticsSite("example", WebAnalyticsSiteArgs.builder()
                .accountId("f037e56e89293a057740de681ac9abbe")
                .zoneTag("0da42c8d2132a9ddaf714f9e7c920711")
                .autoInstall(true)
                .build());
    
        }
    }
    
    resources:
      example:
        type: cloudflare:WebAnalyticsSite
        properties:
          accountId: f037e56e89293a057740de681ac9abbe
          zoneTag: 0da42c8d2132a9ddaf714f9e7c920711
          autoInstall: true
    

    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,
                         host: Optional[str] = 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,
        Host = "string",
        ZoneTag = "string",
    });
    
    example, err := cloudflare.NewWebAnalyticsSite(ctx, "webAnalyticsSiteResource", &cloudflare.WebAnalyticsSiteArgs{
    	AccountId:   pulumi.String("string"),
    	AutoInstall: pulumi.Bool(false),
    	Host:        pulumi.String("string"),
    	ZoneTag:     pulumi.String("string"),
    })
    
    var webAnalyticsSiteResource = new WebAnalyticsSite("webAnalyticsSiteResource", WebAnalyticsSiteArgs.builder()
        .accountId("string")
        .autoInstall(false)
        .host("string")
        .zoneTag("string")
        .build());
    
    web_analytics_site_resource = cloudflare.WebAnalyticsSite("webAnalyticsSiteResource",
        account_id="string",
        auto_install=False,
        host="string",
        zone_tag="string")
    
    const webAnalyticsSiteResource = new cloudflare.WebAnalyticsSite("webAnalyticsSiteResource", {
        accountId: "string",
        autoInstall: false,
        host: "string",
        zoneTag: "string",
    });
    
    type: cloudflare:WebAnalyticsSite
    properties:
        accountId: string
        autoInstall: false
        host: string
        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
    The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    AutoInstall bool
    Whether Cloudflare will automatically inject the JavaScript snippet for orange-clouded sites. Modifying this attribute will force creation of a new resource.
    Host string
    The hostname to use for gray-clouded sites. Must provide only one of zone_tag. Modifying this attribute will force creation of a new resource.
    ZoneTag string
    The zone identifier for orange-clouded sites. Must provide only one of host. 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.
    AutoInstall bool
    Whether Cloudflare will automatically inject the JavaScript snippet for orange-clouded sites. Modifying this attribute will force creation of a new resource.
    Host string
    The hostname to use for gray-clouded sites. Must provide only one of zone_tag. Modifying this attribute will force creation of a new resource.
    ZoneTag string
    The zone identifier for orange-clouded sites. Must provide only one of host. 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.
    autoInstall Boolean
    Whether Cloudflare will automatically inject the JavaScript snippet for orange-clouded sites. Modifying this attribute will force creation of a new resource.
    host String
    The hostname to use for gray-clouded sites. Must provide only one of zone_tag. Modifying this attribute will force creation of a new resource.
    zoneTag String
    The zone identifier for orange-clouded sites. Must provide only one of host. 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.
    autoInstall boolean
    Whether Cloudflare will automatically inject the JavaScript snippet for orange-clouded sites. Modifying this attribute will force creation of a new resource.
    host string
    The hostname to use for gray-clouded sites. Must provide only one of zone_tag. Modifying this attribute will force creation of a new resource.
    zoneTag string
    The zone identifier for orange-clouded sites. Must provide only one of host. 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.
    auto_install bool
    Whether Cloudflare will automatically inject the JavaScript snippet for orange-clouded sites. Modifying this attribute will force creation of a new resource.
    host str
    The hostname to use for gray-clouded sites. Must provide only one of zone_tag. Modifying this attribute will force creation of a new resource.
    zone_tag str
    The zone identifier for orange-clouded sites. Must provide only one of host. 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.
    autoInstall Boolean
    Whether Cloudflare will automatically inject the JavaScript snippet for orange-clouded sites. Modifying this attribute will force creation of a new resource.
    host String
    The hostname to use for gray-clouded sites. Must provide only one of zone_tag. Modifying this attribute will force creation of a new resource.
    zoneTag String
    The zone identifier for orange-clouded sites. Must provide only one of host. Modifying this attribute will force creation of a new resource.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    RulesetId string
    The ID for the ruleset associated to this Web Analytics Site.
    SiteTag string
    The Web Analytics site tag.
    SiteToken string
    The token for the Web Analytics site.
    Snippet string
    The encoded JS snippet to add to your site's HTML page if auto_install is false.
    Id string
    The provider-assigned unique ID for this managed resource.
    RulesetId string
    The ID for the ruleset associated to this Web Analytics Site.
    SiteTag string
    The Web Analytics site tag.
    SiteToken string
    The token for the Web Analytics site.
    Snippet string
    The encoded JS snippet to add to your site's HTML page if auto_install is false.
    id String
    The provider-assigned unique ID for this managed resource.
    rulesetId String
    The ID for the ruleset associated to this Web Analytics Site.
    siteTag String
    The Web Analytics site tag.
    siteToken String
    The token for the Web Analytics site.
    snippet String
    The encoded JS snippet to add to your site's HTML page if auto_install is false.
    id string
    The provider-assigned unique ID for this managed resource.
    rulesetId string
    The ID for the ruleset associated to this Web Analytics Site.
    siteTag string
    The Web Analytics site tag.
    siteToken string
    The token for the Web Analytics site.
    snippet string
    The encoded JS snippet to add to your site's HTML page if auto_install is false.
    id str
    The provider-assigned unique ID for this managed resource.
    ruleset_id str
    The ID for the ruleset associated to this Web Analytics Site.
    site_tag str
    The Web Analytics site tag.
    site_token str
    The token for the Web Analytics site.
    snippet str
    The encoded JS snippet to add to your site's HTML page if auto_install is false.
    id String
    The provider-assigned unique ID for this managed resource.
    rulesetId String
    The ID for the ruleset associated to this Web Analytics Site.
    siteTag String
    The Web Analytics site tag.
    siteToken String
    The token for the Web Analytics site.
    snippet String
    The encoded JS snippet to add to your site's HTML page if auto_install is false.

    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,
            host: Optional[str] = None,
            ruleset_id: Optional[str] = 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)
    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.
    AutoInstall bool
    Whether Cloudflare will automatically inject the JavaScript snippet for orange-clouded sites. Modifying this attribute will force creation of a new resource.
    Host string
    The hostname to use for gray-clouded sites. Must provide only one of zone_tag. Modifying this attribute will force creation of a new resource.
    RulesetId string
    The ID for the ruleset associated to this Web Analytics Site.
    SiteTag string
    The Web Analytics site tag.
    SiteToken string
    The token for the Web Analytics site.
    Snippet string
    The encoded JS snippet to add to your site's HTML page if auto_install is false.
    ZoneTag string
    The zone identifier for orange-clouded sites. Must provide only one of host. 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.
    AutoInstall bool
    Whether Cloudflare will automatically inject the JavaScript snippet for orange-clouded sites. Modifying this attribute will force creation of a new resource.
    Host string
    The hostname to use for gray-clouded sites. Must provide only one of zone_tag. Modifying this attribute will force creation of a new resource.
    RulesetId string
    The ID for the ruleset associated to this Web Analytics Site.
    SiteTag string
    The Web Analytics site tag.
    SiteToken string
    The token for the Web Analytics site.
    Snippet string
    The encoded JS snippet to add to your site's HTML page if auto_install is false.
    ZoneTag string
    The zone identifier for orange-clouded sites. Must provide only one of host. 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.
    autoInstall Boolean
    Whether Cloudflare will automatically inject the JavaScript snippet for orange-clouded sites. Modifying this attribute will force creation of a new resource.
    host String
    The hostname to use for gray-clouded sites. Must provide only one of zone_tag. Modifying this attribute will force creation of a new resource.
    rulesetId String
    The ID for the ruleset associated to this Web Analytics Site.
    siteTag String
    The Web Analytics site tag.
    siteToken String
    The token for the Web Analytics site.
    snippet String
    The encoded JS snippet to add to your site's HTML page if auto_install is false.
    zoneTag String
    The zone identifier for orange-clouded sites. Must provide only one of host. 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.
    autoInstall boolean
    Whether Cloudflare will automatically inject the JavaScript snippet for orange-clouded sites. Modifying this attribute will force creation of a new resource.
    host string
    The hostname to use for gray-clouded sites. Must provide only one of zone_tag. Modifying this attribute will force creation of a new resource.
    rulesetId string
    The ID for the ruleset associated to this Web Analytics Site.
    siteTag string
    The Web Analytics site tag.
    siteToken string
    The token for the Web Analytics site.
    snippet string
    The encoded JS snippet to add to your site's HTML page if auto_install is false.
    zoneTag string
    The zone identifier for orange-clouded sites. Must provide only one of host. 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.
    auto_install bool
    Whether Cloudflare will automatically inject the JavaScript snippet for orange-clouded sites. Modifying this attribute will force creation of a new resource.
    host str
    The hostname to use for gray-clouded sites. Must provide only one of zone_tag. Modifying this attribute will force creation of a new resource.
    ruleset_id str
    The ID for the ruleset associated to this Web Analytics Site.
    site_tag str
    The Web Analytics site tag.
    site_token str
    The token for the Web Analytics site.
    snippet str
    The encoded JS snippet to add to your site's HTML page if auto_install is false.
    zone_tag str
    The zone identifier for orange-clouded sites. Must provide only one of host. 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.
    autoInstall Boolean
    Whether Cloudflare will automatically inject the JavaScript snippet for orange-clouded sites. Modifying this attribute will force creation of a new resource.
    host String
    The hostname to use for gray-clouded sites. Must provide only one of zone_tag. Modifying this attribute will force creation of a new resource.
    rulesetId String
    The ID for the ruleset associated to this Web Analytics Site.
    siteTag String
    The Web Analytics site tag.
    siteToken String
    The token for the Web Analytics site.
    snippet String
    The encoded JS snippet to add to your site's HTML page if auto_install is false.
    zoneTag String
    The zone identifier for orange-clouded sites. Must provide only one of host. Modifying this attribute will force creation of a new resource.

    Import

    $ pulumi import cloudflare:index/webAnalyticsSite:WebAnalyticsSite example <account_id>/<site_tag>
    

    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.43.0 published on Wednesday, Nov 13, 2024 by Pulumi