You can create a .tf file (Terraform File) to configure your Statsig feature gates. All features of console/v1/gates are support
You can create a .tf file (Terraform File) to configure your Statsig feature gates. All features of console/v1/gates are supported. The layout is very similar to the JSON body of a /gates request.Requiring the Statsig provider. (You will need to change the version).
Copy
Ask AI
terraform { required_providers { statsig = { version = "x.x.x" source = "statsig-io/statsig" } }}```text## Basic ExampleThis page explains basic example.Creating a basic gate resource```goresource "statsig_gate" "my_gate" { name = "my_gate" description = "A short description of what this Gate is used for." is_enabled = true id_type = "userID" rules { name = "Public" pass_percentage = 100 conditions { type = "public" } }}```python## ConditionsAll Console API conditions are supported but the syntax needs a little tweaking.- **type** | string | The [type](/console-api/rules#all-conditions) of condition it is.- **operator** | string | What form of evaluation should be run against the **target_value**.- **target_value** | [string] | The value or values you wish to evaluate. Note: This must be an array, and elements should be of string type. (You can put quotes on numbers. 31 -> "31")- **field** | string | Only for custom_field condition type. The name of the field you wish to pull for evaluation from the "custom" object on a user.```goconditions { type = "custom_field" target_value = ["31"] operator = "gt" field = "age"}