published on Wednesday, Jul 22, 2026 by Pulumiverse
published on Wednesday, Jul 22, 2026 by Pulumiverse
Provides a Feature Flag Definition resource.
This resource owns the stable flag contract: the flag key, kind, description, archival state, and variants.
Use this resource by itself when you want Terraform to register the flag but leave ongoing rollout and targeting to the Vercel dashboard.
Vercel requires environments when a flag is created, so this resource bootstraps all environments in a paused state using the neutral control/off variant until rollout is managed elsewhere.
If Terraform should also manage the simplified per-environment rollout, pair this resource with vercel.FeatureFlagConfig.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as vercel from "@pulumiverse/vercel";
const example = new vercel.Project("example", {name: "feature-flag-example"});
const exampleFeatureFlagDefinition = new vercel.FeatureFlagDefinition("example", {
projectId: example.id,
key: "checkout-redesign",
description: "Controls the checkout experience",
kind: "string",
variants: [
{
id: "control",
label: "Control",
valueString: "control",
},
{
id: "treatment",
label: "Treatment",
valueString: "treatment",
},
],
});
import pulumi
import pulumiverse_vercel as vercel
example = vercel.Project("example", name="feature-flag-example")
example_feature_flag_definition = vercel.FeatureFlagDefinition("example",
project_id=example.id,
key="checkout-redesign",
description="Controls the checkout experience",
kind="string",
variants=[
{
"id": "control",
"label": "Control",
"value_string": "control",
},
{
"id": "treatment",
"label": "Treatment",
"value_string": "treatment",
},
])
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-vercel/sdk/v5/go/vercel"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := vercel.NewProject(ctx, "example", &vercel.ProjectArgs{
Name: pulumi.String("feature-flag-example"),
})
if err != nil {
return err
}
_, err = vercel.NewFeatureFlagDefinition(ctx, "example", &vercel.FeatureFlagDefinitionArgs{
ProjectId: example.ID(),
Key: pulumi.String("checkout-redesign"),
Description: pulumi.String("Controls the checkout experience"),
Kind: pulumi.String("string"),
Variants: vercel.FeatureFlagDefinitionVariantArray{
&vercel.FeatureFlagDefinitionVariantArgs{
Id: pulumi.String("control"),
Label: pulumi.String("Control"),
ValueString: pulumi.String("control"),
},
&vercel.FeatureFlagDefinitionVariantArgs{
Id: pulumi.String("treatment"),
Label: pulumi.String("Treatment"),
ValueString: pulumi.String("treatment"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vercel = Pulumiverse.Vercel;
return await Deployment.RunAsync(() =>
{
var example = new Vercel.Project("example", new()
{
Name = "feature-flag-example",
});
var exampleFeatureFlagDefinition = new Vercel.FeatureFlagDefinition("example", new()
{
ProjectId = example.Id,
Key = "checkout-redesign",
Description = "Controls the checkout experience",
Kind = "string",
Variants = new[]
{
new Vercel.Inputs.FeatureFlagDefinitionVariantArgs
{
Id = "control",
Label = "Control",
ValueString = "control",
},
new Vercel.Inputs.FeatureFlagDefinitionVariantArgs
{
Id = "treatment",
Label = "Treatment",
ValueString = "treatment",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumiverse.vercel.Project;
import com.pulumiverse.vercel.ProjectArgs;
import com.pulumiverse.vercel.FeatureFlagDefinition;
import com.pulumiverse.vercel.FeatureFlagDefinitionArgs;
import com.pulumi.vercel.inputs.FeatureFlagDefinitionVariantArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Project("example", ProjectArgs.builder()
.name("feature-flag-example")
.build());
var exampleFeatureFlagDefinition = new FeatureFlagDefinition("exampleFeatureFlagDefinition", FeatureFlagDefinitionArgs.builder()
.projectId(example.id())
.key("checkout-redesign")
.description("Controls the checkout experience")
.kind("string")
.variants(
FeatureFlagDefinitionVariantArgs.builder()
.id("control")
.label("Control")
.valueString("control")
.build(),
FeatureFlagDefinitionVariantArgs.builder()
.id("treatment")
.label("Treatment")
.valueString("treatment")
.build())
.build());
}
}
resources:
example:
type: vercel:Project
properties:
name: feature-flag-example
exampleFeatureFlagDefinition:
type: vercel:FeatureFlagDefinition
name: example
properties:
projectId: ${example.id}
key: checkout-redesign
description: Controls the checkout experience
kind: string
variants:
- id: control
label: Control
valueString: control
- id: treatment
label: Treatment
valueString: treatment
Example coming soon!
Create FeatureFlagDefinition Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new FeatureFlagDefinition(name: string, args: FeatureFlagDefinitionArgs, opts?: CustomResourceOptions);@overload
def FeatureFlagDefinition(resource_name: str,
args: FeatureFlagDefinitionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def FeatureFlagDefinition(resource_name: str,
opts: Optional[ResourceOptions] = None,
key: Optional[str] = None,
kind: Optional[str] = None,
project_id: Optional[str] = None,
variants: Optional[Sequence[FeatureFlagDefinitionVariantArgs]] = None,
archived: Optional[bool] = None,
description: Optional[str] = None,
team_id: Optional[str] = None)func NewFeatureFlagDefinition(ctx *Context, name string, args FeatureFlagDefinitionArgs, opts ...ResourceOption) (*FeatureFlagDefinition, error)public FeatureFlagDefinition(string name, FeatureFlagDefinitionArgs args, CustomResourceOptions? opts = null)
public FeatureFlagDefinition(String name, FeatureFlagDefinitionArgs args)
public FeatureFlagDefinition(String name, FeatureFlagDefinitionArgs args, CustomResourceOptions options)
type: vercel:FeatureFlagDefinition
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "vercel_feature_flag_definition" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args FeatureFlagDefinitionArgs
- 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 FeatureFlagDefinitionArgs
- 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 FeatureFlagDefinitionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args FeatureFlagDefinitionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args FeatureFlagDefinitionArgs
- 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 featureFlagDefinitionResource = new Vercel.FeatureFlagDefinition("featureFlagDefinitionResource", new()
{
Key = "string",
Kind = "string",
ProjectId = "string",
Variants = new[]
{
new Vercel.Inputs.FeatureFlagDefinitionVariantArgs
{
Id = "string",
Description = "string",
Label = "string",
ValueBool = false,
ValueNumber = 0,
ValueString = "string",
},
},
Archived = false,
Description = "string",
TeamId = "string",
});
example, err := vercel.NewFeatureFlagDefinition(ctx, "featureFlagDefinitionResource", &vercel.FeatureFlagDefinitionArgs{
Key: pulumi.String("string"),
Kind: pulumi.String("string"),
ProjectId: pulumi.String("string"),
Variants: vercel.FeatureFlagDefinitionVariantArray{
&vercel.FeatureFlagDefinitionVariantArgs{
Id: pulumi.String("string"),
Description: pulumi.String("string"),
Label: pulumi.String("string"),
ValueBool: pulumi.Bool(false),
ValueNumber: pulumi.Float64(0),
ValueString: pulumi.String("string"),
},
},
Archived: pulumi.Bool(false),
Description: pulumi.String("string"),
TeamId: pulumi.String("string"),
})
resource "vercel_feature_flag_definition" "featureFlagDefinitionResource" {
lifecycle {
create_before_destroy = true
}
key = "string"
kind = "string"
project_id = "string"
variants {
id = "string"
description = "string"
label = "string"
value_bool = false
value_number = 0
value_string = "string"
}
archived = false
description = "string"
team_id = "string"
}
var featureFlagDefinitionResource = new FeatureFlagDefinition("featureFlagDefinitionResource", FeatureFlagDefinitionArgs.builder()
.key("string")
.kind("string")
.projectId("string")
.variants(FeatureFlagDefinitionVariantArgs.builder()
.id("string")
.description("string")
.label("string")
.valueBool(false)
.valueNumber(0.0)
.valueString("string")
.build())
.archived(false)
.description("string")
.teamId("string")
.build());
feature_flag_definition_resource = vercel.FeatureFlagDefinition("featureFlagDefinitionResource",
key="string",
kind="string",
project_id="string",
variants=[{
"id": "string",
"description": "string",
"label": "string",
"value_bool": False,
"value_number": float(0),
"value_string": "string",
}],
archived=False,
description="string",
team_id="string")
const featureFlagDefinitionResource = new vercel.FeatureFlagDefinition("featureFlagDefinitionResource", {
key: "string",
kind: "string",
projectId: "string",
variants: [{
id: "string",
description: "string",
label: "string",
valueBool: false,
valueNumber: 0,
valueString: "string",
}],
archived: false,
description: "string",
teamId: "string",
});
type: vercel:FeatureFlagDefinition
properties:
archived: false
description: string
key: string
kind: string
projectId: string
teamId: string
variants:
- description: string
id: string
label: string
valueBool: false
valueNumber: 0
valueString: string
FeatureFlagDefinition 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 FeatureFlagDefinition resource accepts the following input properties:
- Key string
- The stable flag key used in your application code.
- Kind string
- The type of value this flag returns. Must be one of
boolean,string, ornumber. - Project
Id string - The ID of the Vercel project that owns the flag.
- Variants
List<Pulumiverse.
Vercel. Inputs. Feature Flag Definition Variant> - The variants available for this flag.
- Archived bool
- Whether the flag should be archived instead of active.
- Description string
- A human-readable description of the flag.
- Team
Id string - The ID of the Vercel team. Required when configuring a team resource if a default team has not been set in the provider.
- Key string
- The stable flag key used in your application code.
- Kind string
- The type of value this flag returns. Must be one of
boolean,string, ornumber. - Project
Id string - The ID of the Vercel project that owns the flag.
- Variants
[]Feature
Flag Definition Variant Args - The variants available for this flag.
- Archived bool
- Whether the flag should be archived instead of active.
- Description string
- A human-readable description of the flag.
- Team
Id string - The ID of the Vercel team. Required when configuring a team resource if a default team has not been set in the provider.
- key string
- The stable flag key used in your application code.
- kind string
- The type of value this flag returns. Must be one of
boolean,string, ornumber. - project_
id string - The ID of the Vercel project that owns the flag.
- variants list(object)
- The variants available for this flag.
- archived bool
- Whether the flag should be archived instead of active.
- description string
- A human-readable description of the flag.
- team_
id string - The ID of the Vercel team. Required when configuring a team resource if a default team has not been set in the provider.
- key String
- The stable flag key used in your application code.
- kind String
- The type of value this flag returns. Must be one of
boolean,string, ornumber. - project
Id String - The ID of the Vercel project that owns the flag.
- variants
List<Feature
Flag Definition Variant> - The variants available for this flag.
- archived Boolean
- Whether the flag should be archived instead of active.
- description String
- A human-readable description of the flag.
- team
Id String - The ID of the Vercel team. Required when configuring a team resource if a default team has not been set in the provider.
- key string
- The stable flag key used in your application code.
- kind string
- The type of value this flag returns. Must be one of
boolean,string, ornumber. - project
Id string - The ID of the Vercel project that owns the flag.
- variants
Feature
Flag Definition Variant[] - The variants available for this flag.
- archived boolean
- Whether the flag should be archived instead of active.
- description string
- A human-readable description of the flag.
- team
Id string - The ID of the Vercel team. Required when configuring a team resource if a default team has not been set in the provider.
- key str
- The stable flag key used in your application code.
- kind str
- The type of value this flag returns. Must be one of
boolean,string, ornumber. - project_
id str - The ID of the Vercel project that owns the flag.
- variants
Sequence[Feature
Flag Definition Variant Args] - The variants available for this flag.
- archived bool
- Whether the flag should be archived instead of active.
- description str
- A human-readable description of the flag.
- team_
id str - The ID of the Vercel team. Required when configuring a team resource if a default team has not been set in the provider.
- key String
- The stable flag key used in your application code.
- kind String
- The type of value this flag returns. Must be one of
boolean,string, ornumber. - project
Id String - The ID of the Vercel project that owns the flag.
- variants List<Property Map>
- The variants available for this flag.
- archived Boolean
- Whether the flag should be archived instead of active.
- description String
- A human-readable description of the flag.
- team
Id String - The ID of the Vercel team. Required when configuring a team resource if a default team has not been set in the provider.
Outputs
All input properties are implicitly available as output properties. Additionally, the FeatureFlagDefinition 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 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 FeatureFlagDefinition Resource
Get an existing FeatureFlagDefinition 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?: FeatureFlagDefinitionState, opts?: CustomResourceOptions): FeatureFlagDefinition@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
archived: Optional[bool] = None,
description: Optional[str] = None,
key: Optional[str] = None,
kind: Optional[str] = None,
project_id: Optional[str] = None,
team_id: Optional[str] = None,
variants: Optional[Sequence[FeatureFlagDefinitionVariantArgs]] = None) -> FeatureFlagDefinitionfunc GetFeatureFlagDefinition(ctx *Context, name string, id IDInput, state *FeatureFlagDefinitionState, opts ...ResourceOption) (*FeatureFlagDefinition, error)public static FeatureFlagDefinition Get(string name, Input<string> id, FeatureFlagDefinitionState? state, CustomResourceOptions? opts = null)public static FeatureFlagDefinition get(String name, Output<String> id, FeatureFlagDefinitionState state, CustomResourceOptions options)resources: _: type: vercel:FeatureFlagDefinition get: id: ${id}import {
to = vercel_feature_flag_definition.example
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.
- Archived bool
- Whether the flag should be archived instead of active.
- Description string
- A human-readable description of the flag.
- Key string
- The stable flag key used in your application code.
- Kind string
- The type of value this flag returns. Must be one of
boolean,string, ornumber. - Project
Id string - The ID of the Vercel project that owns the flag.
- Team
Id string - The ID of the Vercel team. Required when configuring a team resource if a default team has not been set in the provider.
- Variants
List<Pulumiverse.
Vercel. Inputs. Feature Flag Definition Variant> - The variants available for this flag.
- Archived bool
- Whether the flag should be archived instead of active.
- Description string
- A human-readable description of the flag.
- Key string
- The stable flag key used in your application code.
- Kind string
- The type of value this flag returns. Must be one of
boolean,string, ornumber. - Project
Id string - The ID of the Vercel project that owns the flag.
- Team
Id string - The ID of the Vercel team. Required when configuring a team resource if a default team has not been set in the provider.
- Variants
[]Feature
Flag Definition Variant Args - The variants available for this flag.
- archived bool
- Whether the flag should be archived instead of active.
- description string
- A human-readable description of the flag.
- key string
- The stable flag key used in your application code.
- kind string
- The type of value this flag returns. Must be one of
boolean,string, ornumber. - project_
id string - The ID of the Vercel project that owns the flag.
- team_
id string - The ID of the Vercel team. Required when configuring a team resource if a default team has not been set in the provider.
- variants list(object)
- The variants available for this flag.
- archived Boolean
- Whether the flag should be archived instead of active.
- description String
- A human-readable description of the flag.
- key String
- The stable flag key used in your application code.
- kind String
- The type of value this flag returns. Must be one of
boolean,string, ornumber. - project
Id String - The ID of the Vercel project that owns the flag.
- team
Id String - The ID of the Vercel team. Required when configuring a team resource if a default team has not been set in the provider.
- variants
List<Feature
Flag Definition Variant> - The variants available for this flag.
- archived boolean
- Whether the flag should be archived instead of active.
- description string
- A human-readable description of the flag.
- key string
- The stable flag key used in your application code.
- kind string
- The type of value this flag returns. Must be one of
boolean,string, ornumber. - project
Id string - The ID of the Vercel project that owns the flag.
- team
Id string - The ID of the Vercel team. Required when configuring a team resource if a default team has not been set in the provider.
- variants
Feature
Flag Definition Variant[] - The variants available for this flag.
- archived bool
- Whether the flag should be archived instead of active.
- description str
- A human-readable description of the flag.
- key str
- The stable flag key used in your application code.
- kind str
- The type of value this flag returns. Must be one of
boolean,string, ornumber. - project_
id str - The ID of the Vercel project that owns the flag.
- team_
id str - The ID of the Vercel team. Required when configuring a team resource if a default team has not been set in the provider.
- variants
Sequence[Feature
Flag Definition Variant Args] - The variants available for this flag.
- archived Boolean
- Whether the flag should be archived instead of active.
- description String
- A human-readable description of the flag.
- key String
- The stable flag key used in your application code.
- kind String
- The type of value this flag returns. Must be one of
boolean,string, ornumber. - project
Id String - The ID of the Vercel project that owns the flag.
- team
Id String - The ID of the Vercel team. Required when configuring a team resource if a default team has not been set in the provider.
- variants List<Property Map>
- The variants available for this flag.
Supporting Types
FeatureFlagDefinitionVariant, FeatureFlagDefinitionVariantArgs
- Id string
- The stable variant identifier referenced by flag configuration.
- Description string
- A human-readable description for the variant.
- Label string
- A human-readable label for the variant.
- Value
Bool bool - The boolean value for this variant. Use this when
kind = "boolean". - Value
Number double - The numeric value for this variant. Use this when
kind = "number". - Value
String string - The string value for this variant. Use this when
kind = "string".
- Id string
- The stable variant identifier referenced by flag configuration.
- Description string
- A human-readable description for the variant.
- Label string
- A human-readable label for the variant.
- Value
Bool bool - The boolean value for this variant. Use this when
kind = "boolean". - Value
Number float64 - The numeric value for this variant. Use this when
kind = "number". - Value
String string - The string value for this variant. Use this when
kind = "string".
- id string
- The stable variant identifier referenced by flag configuration.
- description string
- A human-readable description for the variant.
- label string
- A human-readable label for the variant.
- value_
bool bool - The boolean value for this variant. Use this when
kind = "boolean". - value_
number number - The numeric value for this variant. Use this when
kind = "number". - value_
string string - The string value for this variant. Use this when
kind = "string".
- id String
- The stable variant identifier referenced by flag configuration.
- description String
- A human-readable description for the variant.
- label String
- A human-readable label for the variant.
- value
Bool Boolean - The boolean value for this variant. Use this when
kind = "boolean". - value
Number Double - The numeric value for this variant. Use this when
kind = "number". - value
String String - The string value for this variant. Use this when
kind = "string".
- id string
- The stable variant identifier referenced by flag configuration.
- description string
- A human-readable description for the variant.
- label string
- A human-readable label for the variant.
- value
Bool boolean - The boolean value for this variant. Use this when
kind = "boolean". - value
Number number - The numeric value for this variant. Use this when
kind = "number". - value
String string - The string value for this variant. Use this when
kind = "string".
- id str
- The stable variant identifier referenced by flag configuration.
- description str
- A human-readable description for the variant.
- label str
- A human-readable label for the variant.
- value_
bool bool - The boolean value for this variant. Use this when
kind = "boolean". - value_
number float - The numeric value for this variant. Use this when
kind = "number". - value_
string str - The string value for this variant. Use this when
kind = "string".
- id String
- The stable variant identifier referenced by flag configuration.
- description String
- A human-readable description for the variant.
- label String
- A human-readable label for the variant.
- value
Bool Boolean - The boolean value for this variant. Use this when
kind = "boolean". - value
Number Number - The numeric value for this variant. Use this when
kind = "number". - value
String String - The string value for this variant. Use this when
kind = "string".
Package Details
- Repository
- vercel pulumiverse/pulumi-vercel
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
vercelTerraform Provider.
published on Wednesday, Jul 22, 2026 by Pulumiverse