1. Packages
  2. Statsig Provider
  3. API Docs
  4. Keys
Statsig v0.0.1 published on Friday, Jun 6, 2025 by Statsig

statsig.Keys

Explore with Pulumi AI

statsig logo
Statsig v0.0.1 published on Friday, Jun 6, 2025 by Statsig

    This resource allows you to configure API keys for your Statsig project.

    To learn more about API keys, see API Keys Documentation

    To learn more about the API powering this resource, see Keys API Documentation

    Note: This resource requires a Console API Key with the following scope: can access other keys

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as statsig from "@statsig/pulumi-statsig";
    
    const serverKey = new statsig.Keys("serverKey", {
        description: "A short description of what this server key is used for.",
        environments: ["production"],
        type: "SERVER",
    });
    const clientKey = new statsig.Keys("clientKey", {
        description: "A short description of what this client key is used for.",
        environments: ["production"],
        scopes: ["client_download_config_specs"],
        type: "CLIENT",
    });
    const consoleKey = new statsig.Keys("consoleKey", {
        description: "A short description of what this console key is used for.",
        scopes: ["omni_read_only"],
        type: "CONSOLE",
    });
    
    import pulumi
    import pulumi_statsig as statsig
    
    server_key = statsig.Keys("serverKey",
        description="A short description of what this server key is used for.",
        environments=["production"],
        type="SERVER")
    client_key = statsig.Keys("clientKey",
        description="A short description of what this client key is used for.",
        environments=["production"],
        scopes=["client_download_config_specs"],
        type="CLIENT")
    console_key = statsig.Keys("consoleKey",
        description="A short description of what this console key is used for.",
        scopes=["omni_read_only"],
        type="CONSOLE")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/statsig-io/pulumi-statsig/sdk/go/statsig"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := statsig.NewKeys(ctx, "serverKey", &statsig.KeysArgs{
    			Description: pulumi.String("A short description of what this server key is used for."),
    			Environments: pulumi.StringArray{
    				pulumi.String("production"),
    			},
    			Type: pulumi.String("SERVER"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = statsig.NewKeys(ctx, "clientKey", &statsig.KeysArgs{
    			Description: pulumi.String("A short description of what this client key is used for."),
    			Environments: pulumi.StringArray{
    				pulumi.String("production"),
    			},
    			Scopes: pulumi.StringArray{
    				pulumi.String("client_download_config_specs"),
    			},
    			Type: pulumi.String("CLIENT"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = statsig.NewKeys(ctx, "consoleKey", &statsig.KeysArgs{
    			Description: pulumi.String("A short description of what this console key is used for."),
    			Scopes: pulumi.StringArray{
    				pulumi.String("omni_read_only"),
    			},
    			Type: pulumi.String("CONSOLE"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Pulumi = Statsig.Pulumi;
    
    return await Deployment.RunAsync(() => 
    {
        var serverKey = new Pulumi.Keys("serverKey", new()
        {
            Description = "A short description of what this server key is used for.",
            Environments = new[]
            {
                "production",
            },
            Type = "SERVER",
        });
    
        var clientKey = new Pulumi.Keys("clientKey", new()
        {
            Description = "A short description of what this client key is used for.",
            Environments = new[]
            {
                "production",
            },
            Scopes = new[]
            {
                "client_download_config_specs",
            },
            Type = "CLIENT",
        });
    
        var consoleKey = new Pulumi.Keys("consoleKey", new()
        {
            Description = "A short description of what this console key is used for.",
            Scopes = new[]
            {
                "omni_read_only",
            },
            Type = "CONSOLE",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.statsig.Keys;
    import com.pulumi.statsig.KeysArgs;
    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 serverKey = new Keys("serverKey", KeysArgs.builder()
                .description("A short description of what this server key is used for.")
                .environments("production")
                .type("SERVER")
                .build());
    
            var clientKey = new Keys("clientKey", KeysArgs.builder()
                .description("A short description of what this client key is used for.")
                .environments("production")
                .scopes("client_download_config_specs")
                .type("CLIENT")
                .build());
    
            var consoleKey = new Keys("consoleKey", KeysArgs.builder()
                .description("A short description of what this console key is used for.")
                .scopes("omni_read_only")
                .type("CONSOLE")
                .build());
    
        }
    }
    
    resources:
      serverKey:
        type: statsig:Keys
        properties:
          description: A short description of what this server key is used for.
          environments:
            - production
          type: SERVER
      clientKey:
        type: statsig:Keys
        properties:
          description: A short description of what this client key is used for.
          environments:
            - production
          scopes:
            - client_download_config_specs
          type: CLIENT
      consoleKey:
        type: statsig:Keys
        properties:
          description: A short description of what this console key is used for.
          scopes:
            - omni_read_only
          type: CONSOLE
    

    Create Keys Resource

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

    Constructor syntax

    new Keys(name: string, args: KeysArgs, opts?: CustomResourceOptions);
    @overload
    def Keys(resource_name: str,
             args: KeysArgs,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def Keys(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             description: Optional[str] = None,
             type: Optional[str] = None,
             environments: Optional[Sequence[str]] = None,
             key: Optional[str] = None,
             scopes: Optional[Sequence[str]] = None,
             secondary_target_app_ids: Optional[Sequence[str]] = None,
             target_app_id: Optional[str] = None)
    func NewKeys(ctx *Context, name string, args KeysArgs, opts ...ResourceOption) (*Keys, error)
    public Keys(string name, KeysArgs args, CustomResourceOptions? opts = null)
    public Keys(String name, KeysArgs args)
    public Keys(String name, KeysArgs args, CustomResourceOptions options)
    
    type: statsig:Keys
    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 KeysArgs
    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 KeysArgs
    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 KeysArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args KeysArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args KeysArgs
    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 keysResource = new Pulumi.Keys("keysResource", new()
    {
        Description = "string",
        Type = "string",
        Environments = new[]
        {
            "string",
        },
        Key = "string",
        Scopes = new[]
        {
            "string",
        },
        SecondaryTargetAppIds = new[]
        {
            "string",
        },
        TargetAppId = "string",
    });
    
    example, err := statsig.NewKeys(ctx, "keysResource", &statsig.KeysArgs{
    	Description: pulumi.String("string"),
    	Type:        pulumi.String("string"),
    	Environments: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Key: pulumi.String("string"),
    	Scopes: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	SecondaryTargetAppIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	TargetAppId: pulumi.String("string"),
    })
    
    var keysResource = new Keys("keysResource", KeysArgs.builder()
        .description("string")
        .type("string")
        .environments("string")
        .key("string")
        .scopes("string")
        .secondaryTargetAppIds("string")
        .targetAppId("string")
        .build());
    
    keys_resource = statsig.Keys("keysResource",
        description="string",
        type="string",
        environments=["string"],
        key="string",
        scopes=["string"],
        secondary_target_app_ids=["string"],
        target_app_id="string")
    
    const keysResource = new statsig.Keys("keysResource", {
        description: "string",
        type: "string",
        environments: ["string"],
        key: "string",
        scopes: ["string"],
        secondaryTargetAppIds: ["string"],
        targetAppId: "string",
    });
    
    type: statsig:Keys
    properties:
        description: string
        environments:
            - string
        key: string
        scopes:
            - string
        secondaryTargetAppIds:
            - string
        targetAppId: string
        type: string
    

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

    Description string
    Type string
    Environments List<string>
    Key string
    Scopes List<string>
    SecondaryTargetAppIds List<string>
    TargetAppId string
    Description string
    Type string
    Environments []string
    Key string
    Scopes []string
    SecondaryTargetAppIds []string
    TargetAppId string
    description String
    type String
    environments List<String>
    key String
    scopes List<String>
    secondaryTargetAppIds List<String>
    targetAppId String
    description string
    type string
    environments string[]
    key string
    scopes string[]
    secondaryTargetAppIds string[]
    targetAppId string
    description str
    type str
    environments Sequence[str]
    key str
    scopes Sequence[str]
    secondary_target_app_ids Sequence[str]
    target_app_id str
    description String
    type String
    environments List<String>
    key String
    scopes List<String>
    secondaryTargetAppIds List<String>
    targetAppId String

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Keys 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 Keys Resource

    Get an existing Keys 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?: KeysState, opts?: CustomResourceOptions): Keys
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            environments: Optional[Sequence[str]] = None,
            key: Optional[str] = None,
            scopes: Optional[Sequence[str]] = None,
            secondary_target_app_ids: Optional[Sequence[str]] = None,
            target_app_id: Optional[str] = None,
            type: Optional[str] = None) -> Keys
    func GetKeys(ctx *Context, name string, id IDInput, state *KeysState, opts ...ResourceOption) (*Keys, error)
    public static Keys Get(string name, Input<string> id, KeysState? state, CustomResourceOptions? opts = null)
    public static Keys get(String name, Output<String> id, KeysState state, CustomResourceOptions options)
    resources:  _:    type: statsig:Keys    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:
    Description string
    Environments List<string>
    Key string
    Scopes List<string>
    SecondaryTargetAppIds List<string>
    TargetAppId string
    Type string
    Description string
    Environments []string
    Key string
    Scopes []string
    SecondaryTargetAppIds []string
    TargetAppId string
    Type string
    description String
    environments List<String>
    key String
    scopes List<String>
    secondaryTargetAppIds List<String>
    targetAppId String
    type String
    description string
    environments string[]
    key string
    scopes string[]
    secondaryTargetAppIds string[]
    targetAppId string
    type string
    description str
    environments Sequence[str]
    key str
    scopes Sequence[str]
    secondary_target_app_ids Sequence[str]
    target_app_id str
    type str
    description String
    environments List<String>
    key String
    scopes List<String>
    secondaryTargetAppIds List<String>
    targetAppId String
    type String

    Package Details

    Repository
    statsig statsig-io/pulumi-statsig
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the statsig Terraform Provider.
    statsig logo
    Statsig v0.0.1 published on Friday, Jun 6, 2025 by Statsig