statsig.Gate
Explore with Pulumi AI
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)
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:
- Creator
Email string - Creator
Id string - Description string
- Id
Type string - Is
Enabled bool - Measure
Metric boolLifts - Monitoring
Metrics List<Statsig.Pulumi. Inputs. Gate Monitoring Metric> - Name string
- id
- Rules
List<Statsig.
Pulumi. Inputs. Gate Rule> - List<string>
- Target
Apps List<string> - Team string
- Type string
- Creator
Email string - Creator
Id string - Description string
- Id
Type string - Is
Enabled bool - Measure
Metric boolLifts - Monitoring
Metrics []GateMonitoring Metric Args - Name string
- id
- Rules
[]Gate
Rule Args - []string
- Target
Apps []string - Team string
- Type string
- creator
Email String - creator
Id String - description String
- id
Type String - is
Enabled Boolean - measure
Metric BooleanLifts - monitoring
Metrics List<GateMonitoring Metric> - name String
- id
- rules
List<Gate
Rule> - List<String>
- target
Apps List<String> - team String
- type String
- creator
Email string - creator
Id string - description string
- id
Type string - is
Enabled boolean - measure
Metric booleanLifts - monitoring
Metrics GateMonitoring Metric[] - name string
- id
- rules
Gate
Rule[] - string[]
- target
Apps string[] - team string
- type string
- creator_
email str - creator_
id str - description str
- id_
type str - is_
enabled bool - measure_
metric_ boollifts - monitoring_
metrics Sequence[GateMonitoring Metric Args] - name str
- id
- rules
Sequence[Gate
Rule Args] - Sequence[str]
- target_
apps Sequence[str] - team str
- type str
- creator
Email String - creator
Id String - description String
- id
Type String - is
Enabled Boolean - measure
Metric BooleanLifts - monitoring
Metrics List<Property Map> - name String
- id
- rules List<Property Map>
- List<String>
- target
Apps List<String> - team String
- type String
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.
- Creator
Email string - Creator
Id string - Description string
- Id
Type string - Is
Enabled bool - Measure
Metric boolLifts - Monitoring
Metrics List<Statsig.Pulumi. Inputs. Gate Monitoring Metric> - Name string
- id
- Rules
List<Statsig.
Pulumi. Inputs. Gate Rule> - List<string>
- Target
Apps List<string> - Team string
- Type string
- Creator
Email string - Creator
Id string - Description string
- Id
Type string - Is
Enabled bool - Measure
Metric boolLifts - Monitoring
Metrics []GateMonitoring Metric Args - Name string
- id
- Rules
[]Gate
Rule Args - []string
- Target
Apps []string - Team string
- Type string
- creator
Email String - creator
Id String - description String
- id
Type String - is
Enabled Boolean - measure
Metric BooleanLifts - monitoring
Metrics List<GateMonitoring Metric> - name String
- id
- rules
List<Gate
Rule> - List<String>
- target
Apps List<String> - team String
- type String
- creator
Email string - creator
Id string - description string
- id
Type string - is
Enabled boolean - measure
Metric booleanLifts - monitoring
Metrics GateMonitoring Metric[] - name string
- id
- rules
Gate
Rule[] - string[]
- target
Apps string[] - team string
- type string
- creator_
email str - creator_
id str - description str
- id_
type str - is_
enabled bool - measure_
metric_ boollifts - monitoring_
metrics Sequence[GateMonitoring Metric Args] - name str
- id
- rules
Sequence[Gate
Rule Args] - Sequence[str]
- target_
apps Sequence[str] - team str
- type str
- creator
Email String - creator
Id String - description String
- id
Type String - is
Enabled Boolean - measure
Metric BooleanLifts - monitoring
Metrics List<Property Map> - name String
- id
- rules List<Property Map>
- List<String>
- target
Apps List<String> - team String
- type String
Supporting Types
GateMonitoringMetric, GateMonitoringMetricArgs
GateRule, GateRuleArgs
- Conditions
List<Statsig.
Pulumi. Inputs. Gate Rule Condition> - An array of Condition objects.
- Name string
- The name of this rule.
- Pass
Percentage double - Of the users that meet the conditions of this rule, what percent should return true.
- Base
Id 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.
- Return
Value Statsig.Pulumi. Inputs. Gate Rule Return Value - The return value of the rule.
- Conditions
[]Gate
Rule Condition - An array of Condition objects.
- Name string
- The name of this rule.
- Pass
Percentage float64 - Of the users that meet the conditions of this rule, what percent should return true.
- Base
Id 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.
- Return
Value GateRule Return Value - The return value of the rule.
- conditions
List<Gate
Rule Condition> - An array of Condition objects.
- name String
- The name of this rule.
- pass
Percentage Double - Of the users that meet the conditions of this rule, what percent should return true.
- base
Id 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.
- return
Value GateRule Return Value - The return value of the rule.
- conditions
Gate
Rule Condition[] - An array of Condition objects.
- name string
- The name of this rule.
- pass
Percentage number - Of the users that meet the conditions of this rule, what percent should return true.
- base
Id 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.
- return
Value GateRule Return Value - The return value of the rule.
- conditions
Sequence[Gate
Rule Condition] - 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 GateRule Return Value - The return value of the rule.
- conditions List<Property Map>
- An array of Condition objects.
- name String
- The name of this rule.
- pass
Percentage Number - Of the users that meet the conditions of this rule, what percent should return true.
- base
Id 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.
- return
Value Property Map - The return value of the rule.
GateRuleCondition, GateRuleConditionArgs
- Type string
- Custom
Id string - Field string
- Operator string
- Target
Values List<string>
- Type string
- Custom
Id string - Field string
- Operator string
- Target
Values []string
- type String
- custom
Id String - field String
- operator String
- target
Values List<String>
- type string
- custom
Id string - field string
- operator string
- target
Values string[]
- type str
- custom_
id str - field str
- operator str
- target_
values Sequence[str]
- type String
- custom
Id String - field String
- operator String
- target
Values 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.