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

statsig.Gate

Explore with Pulumi AI

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

    This resource allows you to configure gates for your Statsig project.

    To learn more about gates, see Gates Documentation

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

    Example Usage

    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    resources:
      full:
        type: statsig:Gate
        properties:
          description: A short description of what this Gate is used for.
          idType: userID
          isEnabled: true
          rules:
            - conditions:
                - targetValue: []
                  type: public
                - operator: any
                  targetValue:
                    - '1'
                    - '2'
                  type: user_id
                - operator: str_contains_any
                  targetValue:
                    - '@outlook.com'
                    - '@gmail.com'
                  type: email
                - field: age
                  operator: gt
                  targetValue:
                    - 31
                  type: custom_field
                - operator: version_gt
                  targetValue:
                    - 1.1.1
                  type: app_version
                - operator: any
                  targetValue:
                    - Firefox
                    - Chrome
                  type: browser_name
                - operator: any
                  targetValue:
                    - 94.0.4606.81
                    - 94.0.4606.92
                  type: browser_version
                - operator: none
                  targetValue:
                    - Android
                    - Windows
                  type: os_name
                - operator: version_lte
                  targetValue:
                    - 11.0.0
                  type: os_version
                - operator: any
                  targetValue:
                    - NZ
                    - US
                  type: country
                - targetValue:
                    - my_gate_2
                  type: passes_gate
                - targetValue:
                    - a_failing_gate
                  type: fails_gate
                - operator: after
                  targetValue:
                    - 1.643070357193e+12
                  type: time
                - operator: any
                  targetValue:
                    - production
                  type: environment_tier
                - targetValue:
                    - growth_org
                  type: passes_segment
                - targetValue:
                    - promo_id_list
                  type: fails_segment
                - operator: any
                  targetValue:
                    - 1.1.1.1
                    - 8.8.8.8
                  type: ip_address
              environments:
                - production
              name: All Conditions
              pass_percentage: 10
            - conditions:
                - targetValue: []
                  type: public
              environments:
                - development
              name: Development Conditions
              pass_percentage: 10
      simple:
        type: statsig:Gate
        properties:
          description: A short description of what Another Gate is used for.
          idType: userID
          isEnabled: false
          rules:
            - conditions:
                - type: public
              name: All Conditions
              pass_percentage: 10
    

    Create Gate Resource

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

    Constructor syntax

    new Gate(name: string, args?: GateArgs, opts?: CustomResourceOptions);
    @overload
    def Gate(resource_name: str,
             args: Optional[GateArgs] = None,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def Gate(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             creator_email: Optional[str] = None,
             creator_id: Optional[str] = None,
             description: Optional[str] = None,
             id_type: Optional[str] = None,
             is_enabled: Optional[bool] = None,
             measure_metric_lifts: Optional[bool] = None,
             monitoring_metrics: Optional[Sequence[GateMonitoringMetricArgs]] = None,
             name: Optional[str] = None,
             rules: Optional[Sequence[GateRuleArgs]] = None,
             tags: Optional[Sequence[str]] = None,
             target_apps: Optional[Sequence[str]] = None,
             team: Optional[str] = None,
             type: Optional[str] = None)
    func NewGate(ctx *Context, name string, args *GateArgs, opts ...ResourceOption) (*Gate, error)
    public Gate(string name, GateArgs? args = null, CustomResourceOptions? opts = null)
    public Gate(String name, GateArgs args)
    public Gate(String name, GateArgs args, CustomResourceOptions options)
    
    type: statsig:Gate
    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 GateArgs
    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 GateArgs
    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 GateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GateArgs
    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 gateResource = new Pulumi.Gate("gateResource", new()
    {
        CreatorEmail = "string",
        CreatorId = "string",
        Description = "string",
        IdType = "string",
        IsEnabled = false,
        MeasureMetricLifts = false,
        MonitoringMetrics = new[]
        {
            new Pulumi.Inputs.GateMonitoringMetricArgs
            {
                Name = "string",
                Type = "string",
            },
        },
        Name = "string",
        Rules = new[]
        {
            new Pulumi.Inputs.GateRuleArgs
            {
                Conditions = new[]
                {
                    new Pulumi.Inputs.GateRuleConditionArgs
                    {
                        Type = "string",
                        CustomId = "string",
                        Field = "string",
                        Operator = "string",
                        TargetValues = new[]
                        {
                            "string",
                        },
                    },
                },
                Name = "string",
                PassPercentage = 0,
                BaseId = "string",
                Environments = new[]
                {
                    "string",
                },
                Id = "string",
                ReturnValue = null,
            },
        },
        Tags = new[]
        {
            "string",
        },
        TargetApps = new[]
        {
            "string",
        },
        Team = "string",
        Type = "string",
    });
    
    example, err := statsig.NewGate(ctx, "gateResource", &statsig.GateArgs{
    	CreatorEmail:       pulumi.String("string"),
    	CreatorId:          pulumi.String("string"),
    	Description:        pulumi.String("string"),
    	IdType:             pulumi.String("string"),
    	IsEnabled:          pulumi.Bool(false),
    	MeasureMetricLifts: pulumi.Bool(false),
    	MonitoringMetrics: statsig.GateMonitoringMetricArray{
    		&statsig.GateMonitoringMetricArgs{
    			Name: pulumi.String("string"),
    			Type: pulumi.String("string"),
    		},
    	},
    	Name: pulumi.String("string"),
    	Rules: statsig.GateRuleArray{
    		&statsig.GateRuleArgs{
    			Conditions: statsig.GateRuleConditionArray{
    				&statsig.GateRuleConditionArgs{
    					Type:     pulumi.String("string"),
    					CustomId: pulumi.String("string"),
    					Field:    pulumi.String("string"),
    					Operator: pulumi.String("string"),
    					TargetValues: pulumi.StringArray{
    						pulumi.String("string"),
    					},
    				},
    			},
    			Name:           pulumi.String("string"),
    			PassPercentage: pulumi.Float64(0),
    			BaseId:         pulumi.String("string"),
    			Environments: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			Id:          pulumi.String("string"),
    			ReturnValue: &statsig.GateRuleReturnValueArgs{},
    		},
    	},
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	TargetApps: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Team: pulumi.String("string"),
    	Type: pulumi.String("string"),
    })
    
    var gateResource = new Gate("gateResource", GateArgs.builder()
        .creatorEmail("string")
        .creatorId("string")
        .description("string")
        .idType("string")
        .isEnabled(false)
        .measureMetricLifts(false)
        .monitoringMetrics(GateMonitoringMetricArgs.builder()
            .name("string")
            .type("string")
            .build())
        .name("string")
        .rules(GateRuleArgs.builder()
            .conditions(GateRuleConditionArgs.builder()
                .type("string")
                .customId("string")
                .field("string")
                .operator("string")
                .targetValues("string")
                .build())
            .name("string")
            .passPercentage(0.0)
            .baseId("string")
            .environments("string")
            .id("string")
            .returnValue(GateRuleReturnValueArgs.builder()
                .build())
            .build())
        .tags("string")
        .targetApps("string")
        .team("string")
        .type("string")
        .build());
    
    gate_resource = statsig.Gate("gateResource",
        creator_email="string",
        creator_id="string",
        description="string",
        id_type="string",
        is_enabled=False,
        measure_metric_lifts=False,
        monitoring_metrics=[{
            "name": "string",
            "type": "string",
        }],
        name="string",
        rules=[{
            "conditions": [{
                "type": "string",
                "custom_id": "string",
                "field": "string",
                "operator": "string",
                "target_values": ["string"],
            }],
            "name": "string",
            "pass_percentage": 0,
            "base_id": "string",
            "environments": ["string"],
            "id": "string",
            "return_value": {},
        }],
        tags=["string"],
        target_apps=["string"],
        team="string",
        type="string")
    
    const gateResource = new statsig.Gate("gateResource", {
        creatorEmail: "string",
        creatorId: "string",
        description: "string",
        idType: "string",
        isEnabled: false,
        measureMetricLifts: false,
        monitoringMetrics: [{
            name: "string",
            type: "string",
        }],
        name: "string",
        rules: [{
            conditions: [{
                type: "string",
                customId: "string",
                field: "string",
                operator: "string",
                targetValues: ["string"],
            }],
            name: "string",
            passPercentage: 0,
            baseId: "string",
            environments: ["string"],
            id: "string",
            returnValue: {},
        }],
        tags: ["string"],
        targetApps: ["string"],
        team: "string",
        type: "string",
    });
    
    type: statsig:Gate
    properties:
        creatorEmail: string
        creatorId: string
        description: string
        idType: string
        isEnabled: false
        measureMetricLifts: false
        monitoringMetrics:
            - name: string
              type: string
        name: string
        rules:
            - baseId: string
              conditions:
                - customId: string
                  field: string
                  operator: string
                  targetValues:
                    - string
                  type: string
              environments:
                - string
              id: string
              name: string
              passPercentage: 0
              returnValue: {}
        tags:
            - string
        targetApps:
            - string
        team: string
        type: string
    

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

    Outputs

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

    Get an existing Gate 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?: GateState, opts?: CustomResourceOptions): Gate
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            creator_email: Optional[str] = None,
            creator_id: Optional[str] = None,
            description: Optional[str] = None,
            id_type: Optional[str] = None,
            is_enabled: Optional[bool] = None,
            measure_metric_lifts: Optional[bool] = None,
            monitoring_metrics: Optional[Sequence[GateMonitoringMetricArgs]] = None,
            name: Optional[str] = None,
            rules: Optional[Sequence[GateRuleArgs]] = None,
            tags: Optional[Sequence[str]] = None,
            target_apps: Optional[Sequence[str]] = None,
            team: Optional[str] = None,
            type: Optional[str] = None) -> Gate
    func GetGate(ctx *Context, name string, id IDInput, state *GateState, opts ...ResourceOption) (*Gate, error)
    public static Gate Get(string name, Input<string> id, GateState? state, CustomResourceOptions? opts = null)
    public static Gate get(String name, Output<String> id, GateState state, CustomResourceOptions options)
    resources:  _:    type: statsig:Gate    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:

    Supporting Types

    GateMonitoringMetric, GateMonitoringMetricArgs

    Name string
    Type string
    Name string
    Type string
    name String
    type String
    name string
    type string
    name str
    type str
    name String
    type String

    GateRule, GateRuleArgs

    Conditions List<Statsig.Pulumi.Inputs.GateRuleCondition>
    An array of Condition objects.
    Name string
    The name of this rule.
    PassPercentage double
    Of the users that meet the conditions of this rule, what percent should return true.
    BaseId string
    The base ID of this rule, i.e. without any added metadata. Will remain the exact same throughout
    Environments List<string>
    The environments this rule is enabled for.
    Id string
    The Statsig ID of this rule.
    ReturnValue Statsig.Pulumi.Inputs.GateRuleReturnValue
    The return value of the rule.
    Conditions []GateRuleCondition
    An array of Condition objects.
    Name string
    The name of this rule.
    PassPercentage float64
    Of the users that meet the conditions of this rule, what percent should return true.
    BaseId string
    The base ID of this rule, i.e. without any added metadata. Will remain the exact same throughout
    Environments []string
    The environments this rule is enabled for.
    Id string
    The Statsig ID of this rule.
    ReturnValue GateRuleReturnValue
    The return value of the rule.
    conditions List<GateRuleCondition>
    An array of Condition objects.
    name String
    The name of this rule.
    passPercentage Double
    Of the users that meet the conditions of this rule, what percent should return true.
    baseId String
    The base ID of this rule, i.e. without any added metadata. Will remain the exact same throughout
    environments List<String>
    The environments this rule is enabled for.
    id String
    The Statsig ID of this rule.
    returnValue GateRuleReturnValue
    The return value of the rule.
    conditions GateRuleCondition[]
    An array of Condition objects.
    name string
    The name of this rule.
    passPercentage number
    Of the users that meet the conditions of this rule, what percent should return true.
    baseId string
    The base ID of this rule, i.e. without any added metadata. Will remain the exact same throughout
    environments string[]
    The environments this rule is enabled for.
    id string
    The Statsig ID of this rule.
    returnValue GateRuleReturnValue
    The return value of the rule.
    conditions Sequence[GateRuleCondition]
    An array of Condition objects.
    name str
    The name of this rule.
    pass_percentage float
    Of the users that meet the conditions of this rule, what percent should return true.
    base_id str
    The base ID of this rule, i.e. without any added metadata. Will remain the exact same throughout
    environments Sequence[str]
    The environments this rule is enabled for.
    id str
    The Statsig ID of this rule.
    return_value GateRuleReturnValue
    The return value of the rule.
    conditions List<Property Map>
    An array of Condition objects.
    name String
    The name of this rule.
    passPercentage Number
    Of the users that meet the conditions of this rule, what percent should return true.
    baseId String
    The base ID of this rule, i.e. without any added metadata. Will remain the exact same throughout
    environments List<String>
    The environments this rule is enabled for.
    id String
    The Statsig ID of this rule.
    returnValue Property Map
    The return value of the rule.

    GateRuleCondition, GateRuleConditionArgs

    Type string
    CustomId string
    Field string
    Operator string
    TargetValues List<string>
    Type string
    CustomId string
    Field string
    Operator string
    TargetValues []string
    type String
    customId String
    field String
    operator String
    targetValues List<String>
    type string
    customId string
    field string
    operator string
    targetValues string[]
    type str
    custom_id str
    field str
    operator str
    target_values Sequence[str]
    type String
    customId String
    field String
    operator String
    targetValues List<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