1. Packages
  2. Netlify Provider
  3. API Docs
  4. SiteMetricsSettings
netlify 0.2.2 published on Friday, Mar 7, 2025 by netlify

netlify.SiteMetricsSettings

Explore with Pulumi AI

netlify logo
netlify 0.2.2 published on Friday, Mar 7, 2025 by netlify

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as netlify from "@pulumi/netlify";
    
    const blog = new netlify.SiteMetricsSettings("blog", {
        siteId: data.netlify_site.blog.id,
        siteAnalytics: true,
        realUserMetrics: true,
    });
    
    import pulumi
    import pulumi_netlify as netlify
    
    blog = netlify.SiteMetricsSettings("blog",
        site_id=data["netlify_site"]["blog"]["id"],
        site_analytics=True,
        real_user_metrics=True)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/netlify/netlify"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := netlify.NewSiteMetricsSettings(ctx, "blog", &netlify.SiteMetricsSettingsArgs{
    			SiteId:          pulumi.Any(data.Netlify_site.Blog.Id),
    			SiteAnalytics:   pulumi.Bool(true),
    			RealUserMetrics: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Netlify = Pulumi.Netlify;
    
    return await Deployment.RunAsync(() => 
    {
        var blog = new Netlify.SiteMetricsSettings("blog", new()
        {
            SiteId = data.Netlify_site.Blog.Id,
            SiteAnalytics = true,
            RealUserMetrics = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.netlify.SiteMetricsSettings;
    import com.pulumi.netlify.SiteMetricsSettingsArgs;
    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 blog = new SiteMetricsSettings("blog", SiteMetricsSettingsArgs.builder()
                .siteId(data.netlify_site().blog().id())
                .siteAnalytics(true)
                .realUserMetrics(true)
                .build());
    
        }
    }
    
    resources:
      blog:
        type: netlify:SiteMetricsSettings
        properties:
          siteId: ${data.netlify_site.blog.id}
          siteAnalytics: true
          realUserMetrics: true
    

    Create SiteMetricsSettings Resource

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

    Constructor syntax

    new SiteMetricsSettings(name: string, args: SiteMetricsSettingsArgs, opts?: CustomResourceOptions);
    @overload
    def SiteMetricsSettings(resource_name: str,
                            args: SiteMetricsSettingsArgs,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def SiteMetricsSettings(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            site_id: Optional[str] = None,
                            real_user_metrics: Optional[bool] = None,
                            site_analytics: Optional[bool] = None)
    func NewSiteMetricsSettings(ctx *Context, name string, args SiteMetricsSettingsArgs, opts ...ResourceOption) (*SiteMetricsSettings, error)
    public SiteMetricsSettings(string name, SiteMetricsSettingsArgs args, CustomResourceOptions? opts = null)
    public SiteMetricsSettings(String name, SiteMetricsSettingsArgs args)
    public SiteMetricsSettings(String name, SiteMetricsSettingsArgs args, CustomResourceOptions options)
    
    type: netlify:SiteMetricsSettings
    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 SiteMetricsSettingsArgs
    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 SiteMetricsSettingsArgs
    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 SiteMetricsSettingsArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SiteMetricsSettingsArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SiteMetricsSettingsArgs
    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 siteMetricsSettingsResource = new Netlify.SiteMetricsSettings("siteMetricsSettingsResource", new()
    {
        SiteId = "string",
        RealUserMetrics = false,
        SiteAnalytics = false,
    });
    
    example, err := netlify.NewSiteMetricsSettings(ctx, "siteMetricsSettingsResource", &netlify.SiteMetricsSettingsArgs{
    SiteId: pulumi.String("string"),
    RealUserMetrics: pulumi.Bool(false),
    SiteAnalytics: pulumi.Bool(false),
    })
    
    var siteMetricsSettingsResource = new SiteMetricsSettings("siteMetricsSettingsResource", SiteMetricsSettingsArgs.builder()
        .siteId("string")
        .realUserMetrics(false)
        .siteAnalytics(false)
        .build());
    
    site_metrics_settings_resource = netlify.SiteMetricsSettings("siteMetricsSettingsResource",
        site_id="string",
        real_user_metrics=False,
        site_analytics=False)
    
    const siteMetricsSettingsResource = new netlify.SiteMetricsSettings("siteMetricsSettingsResource", {
        siteId: "string",
        realUserMetrics: false,
        siteAnalytics: false,
    });
    
    type: netlify:SiteMetricsSettings
    properties:
        realUserMetrics: false
        siteAnalytics: false
        siteId: string
    

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

    SiteId string
    RealUserMetrics bool
    Enable real user metrics. Warning: This might incur a cost on certain plans.
    SiteAnalytics bool
    Enable site analytics. Warning: This might incur a cost on certain plans. Note: You must wait 10 minutes before disabling after enabling.
    SiteId string
    RealUserMetrics bool
    Enable real user metrics. Warning: This might incur a cost on certain plans.
    SiteAnalytics bool
    Enable site analytics. Warning: This might incur a cost on certain plans. Note: You must wait 10 minutes before disabling after enabling.
    siteId String
    realUserMetrics Boolean
    Enable real user metrics. Warning: This might incur a cost on certain plans.
    siteAnalytics Boolean
    Enable site analytics. Warning: This might incur a cost on certain plans. Note: You must wait 10 minutes before disabling after enabling.
    siteId string
    realUserMetrics boolean
    Enable real user metrics. Warning: This might incur a cost on certain plans.
    siteAnalytics boolean
    Enable site analytics. Warning: This might incur a cost on certain plans. Note: You must wait 10 minutes before disabling after enabling.
    site_id str
    real_user_metrics bool
    Enable real user metrics. Warning: This might incur a cost on certain plans.
    site_analytics bool
    Enable site analytics. Warning: This might incur a cost on certain plans. Note: You must wait 10 minutes before disabling after enabling.
    siteId String
    realUserMetrics Boolean
    Enable real user metrics. Warning: This might incur a cost on certain plans.
    siteAnalytics Boolean
    Enable site analytics. Warning: This might incur a cost on certain plans. Note: You must wait 10 minutes before disabling after enabling.

    Outputs

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

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

    Look up Existing SiteMetricsSettings Resource

    Get an existing SiteMetricsSettings 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?: SiteMetricsSettingsState, opts?: CustomResourceOptions): SiteMetricsSettings
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            last_updated: Optional[str] = None,
            real_user_metrics: Optional[bool] = None,
            site_analytics: Optional[bool] = None,
            site_id: Optional[str] = None) -> SiteMetricsSettings
    func GetSiteMetricsSettings(ctx *Context, name string, id IDInput, state *SiteMetricsSettingsState, opts ...ResourceOption) (*SiteMetricsSettings, error)
    public static SiteMetricsSettings Get(string name, Input<string> id, SiteMetricsSettingsState? state, CustomResourceOptions? opts = null)
    public static SiteMetricsSettings get(String name, Output<String> id, SiteMetricsSettingsState state, CustomResourceOptions options)
    resources:  _:    type: netlify:SiteMetricsSettings    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:
    LastUpdated string
    RealUserMetrics bool
    Enable real user metrics. Warning: This might incur a cost on certain plans.
    SiteAnalytics bool
    Enable site analytics. Warning: This might incur a cost on certain plans. Note: You must wait 10 minutes before disabling after enabling.
    SiteId string
    LastUpdated string
    RealUserMetrics bool
    Enable real user metrics. Warning: This might incur a cost on certain plans.
    SiteAnalytics bool
    Enable site analytics. Warning: This might incur a cost on certain plans. Note: You must wait 10 minutes before disabling after enabling.
    SiteId string
    lastUpdated String
    realUserMetrics Boolean
    Enable real user metrics. Warning: This might incur a cost on certain plans.
    siteAnalytics Boolean
    Enable site analytics. Warning: This might incur a cost on certain plans. Note: You must wait 10 minutes before disabling after enabling.
    siteId String
    lastUpdated string
    realUserMetrics boolean
    Enable real user metrics. Warning: This might incur a cost on certain plans.
    siteAnalytics boolean
    Enable site analytics. Warning: This might incur a cost on certain plans. Note: You must wait 10 minutes before disabling after enabling.
    siteId string
    last_updated str
    real_user_metrics bool
    Enable real user metrics. Warning: This might incur a cost on certain plans.
    site_analytics bool
    Enable site analytics. Warning: This might incur a cost on certain plans. Note: You must wait 10 minutes before disabling after enabling.
    site_id str
    lastUpdated String
    realUserMetrics Boolean
    Enable real user metrics. Warning: This might incur a cost on certain plans.
    siteAnalytics Boolean
    Enable site analytics. Warning: This might incur a cost on certain plans. Note: You must wait 10 minutes before disabling after enabling.
    siteId String

    Import

    Import a site’s metrics settings by the site ID

    $ pulumi import netlify:index/siteMetricsSettings:SiteMetricsSettings blog 12345667-0000-0000-0000-abcdef012345
    

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

    Package Details

    Repository
    netlify netlify/terraform-provider-netlify
    License
    Notes
    This Pulumi package is based on the netlify Terraform Provider.
    netlify logo
    netlify 0.2.2 published on Friday, Mar 7, 2025 by netlify