Skip to main content

InsightVariable

Resource InsightVariable in pulumi-posthog.
3 min read

Resource InsightVariable in pulumi-posthog.

Pulumi type: posthog:index/insightVariable:InsightVariable.

name is the Pulumi resource name. Nested object fields are documented under that object. They are not arguments of this resource.

Example#

Only required arguments are set. A string in angle brackets stands in for that argument. Any other value is an option or example written in the SDK description.

Arguments#

PropertyTypeRequiredDescription
defaultValueJsonstringnoJSON-encoded default value used when a query references the variable and no value is supplied. The value is a bare JSON scalar for most types, so wrap it: jsonencode("prod"), jsonencode(30), jsonencode(true). For List variables PostHog stores the default as a string, so encode it as one.
namestringnoHuman-readable name for the SQL variable, shown above the input.
projectIdstringnoProject ID (environment) for this resource. Overrides the provider-level project_id.
typestringyesVariable type, which controls how the value is rendered and substituted into HogQL: String, Number, Boolean, List, or Date.
valuesJsonstringnoJSON-encoded array of allowed values, for List variables only. PostHog stores every entry as a string, so encode them as strings: jsonencode(["1", "2"]) rather than jsonencode([1, 2]). Otherwise the value PostHog returns will not match your configuration. Leave unset for other variable types.

Outputs#

Computed outputs are produced by the provider. They are not constructor arguments.

PropertyTypeComputedDescription
codeNamestringyesCode-safe name generated from name, referenced in HogQL as {variables.code_name}. PostHog derives it once at creation and keeps it if you later rename the variable, so queries do not break on a rename. It must be unique within the project.
createdAtstringyesTimestamp when the SQL variable was created.
defaultValueJsonstringnoJSON-encoded default value used when a query references the variable and no value is supplied. The value is a bare JSON scalar for most types, so wrap it: jsonencode("prod"), jsonencode(30), jsonencode(true). For List variables PostHog stores the default as a string, so encode it as one.
namestringnoHuman-readable name for the SQL variable, shown above the input.
projectIdstringnoProject ID (environment) for this resource. Overrides the provider-level project_id.
typestringnoVariable type, which controls how the value is rendered and substituted into HogQL: String, Number, Boolean, List, or Date.
valuesJsonstringnoJSON-encoded array of allowed values, for List variables only. PostHog stores every entry as a string, so encode them as strings: jsonencode(["1", "2"]) rather than jsonencode([1, 2]). Otherwise the value PostHog returns will not match your configuration. Leave unset for other variable types.