Skip to main content
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).

Basic Example

Creating a basic gate resource

Conditions

All Console API conditions are supported but the syntax needs a little tweaking.
  • type | string | The type 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.
See the full list of conditions here. A full gate example is included in the open source Github repo https://github.com/statsig-io/terraform-provider-statsig/blob/main/statsig/test_resources/gate_full.tf