published on Wednesday, Jul 22, 2026 by Pulumiverse
published on Wednesday, Jul 22, 2026 by Pulumiverse
Provides a Feature Flag Segment resource.
This first draft focuses on exact-match membership lists through include and exclude entries. Dashboard-defined rule logic is intentionally not flattened into Terraform here.
Vercel’s API requires a hint field even for simple segments, so this resource defaults it to an empty string unless you want to populate it for dashboard users.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as vercel from "@pulumiverse/vercel";
const example = new vercel.Project("example", {name: "feature-flag-segment-example"});
const exampleFeatureFlagSegment = new vercel.FeatureFlagSegment("example", {
projectId: example.id,
slug: "internal-users",
name: "Internal Users",
description: "Employees who should always see internal-only flag treatments",
hint: "user-email",
includes: [{
entity: "user",
attribute: "email",
values: [
"alice@example.com",
"bob@example.com",
],
}],
excludes: [{
entity: "user",
attribute: "id",
values: ["contractor-123"],
}],
});
import pulumi
import pulumiverse_vercel as vercel
example = vercel.Project("example", name="feature-flag-segment-example")
example_feature_flag_segment = vercel.FeatureFlagSegment("example",
project_id=example.id,
slug="internal-users",
name="Internal Users",
description="Employees who should always see internal-only flag treatments",
hint="user-email",
includes=[{
"entity": "user",
"attribute": "email",
"values": [
"alice@example.com",
"bob@example.com",
],
}],
excludes=[{
"entity": "user",
"attribute": "id",
"values": ["contractor-123"],
}])
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-segment-example"),
})
if err != nil {
return err
}
_, err = vercel.NewFeatureFlagSegment(ctx, "example", &vercel.FeatureFlagSegmentArgs{
ProjectId: example.ID(),
Slug: pulumi.String("internal-users"),
Name: pulumi.String("Internal Users"),
Description: pulumi.String("Employees who should always see internal-only flag treatments"),
Hint: pulumi.String("user-email"),
Includes: vercel.FeatureFlagSegmentIncludeArray{
&vercel.FeatureFlagSegmentIncludeArgs{
Entity: pulumi.String("user"),
Attribute: pulumi.String("email"),
Values: pulumi.StringArray{
pulumi.String("alice@example.com"),
pulumi.String("bob@example.com"),
},
},
},
Excludes: vercel.FeatureFlagSegmentExcludeArray{
&vercel.FeatureFlagSegmentExcludeArgs{
Entity: pulumi.String("user"),
Attribute: pulumi.String("id"),
Values: pulumi.StringArray{
pulumi.String("contractor-123"),
},
},
},
})
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-segment-example",
});
var exampleFeatureFlagSegment = new Vercel.FeatureFlagSegment("example", new()
{
ProjectId = example.Id,
Slug = "internal-users",
Name = "Internal Users",
Description = "Employees who should always see internal-only flag treatments",
Hint = "user-email",
Includes = new[]
{
new Vercel.Inputs.FeatureFlagSegmentIncludeArgs
{
Entity = "user",
Attribute = "email",
Values = new[]
{
"alice@example.com",
"bob@example.com",
},
},
},
Excludes = new[]
{
new Vercel.Inputs.FeatureFlagSegmentExcludeArgs
{
Entity = "user",
Attribute = "id",
Values = new[]
{
"contractor-123",
},
},
},
});
});
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.FeatureFlagSegment;
import com.pulumiverse.vercel.FeatureFlagSegmentArgs;
import com.pulumi.vercel.inputs.FeatureFlagSegmentIncludeArgs;
import com.pulumi.vercel.inputs.FeatureFlagSegmentExcludeArgs;
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-segment-example")
.build());
var exampleFeatureFlagSegment = new FeatureFlagSegment("exampleFeatureFlagSegment", FeatureFlagSegmentArgs.builder()
.projectId(example.id())
.slug("internal-users")
.name("Internal Users")
.description("Employees who should always see internal-only flag treatments")
.hint("user-email")
.includes(FeatureFlagSegmentIncludeArgs.builder()
.entity("user")
.attribute("email")
.values(
"alice@example.com",
"bob@example.com")
.build())
.excludes(FeatureFlagSegmentExcludeArgs.builder()
.entity("user")
.attribute("id")
.values("contractor-123")
.build())
.build());
}
}
resources:
example:
type: vercel:Project
properties:
name: feature-flag-segment-example
exampleFeatureFlagSegment:
type: vercel:FeatureFlagSegment
name: example
properties:
projectId: ${example.id}
slug: internal-users
name: Internal Users
description: Employees who should always see internal-only flag treatments
hint: user-email
includes:
- entity: user
attribute: email
values:
- alice@example.com
- bob@example.com
excludes:
- entity: user
attribute: id
values:
- contractor-123
Example coming soon!
Create FeatureFlagSegment Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new FeatureFlagSegment(name: string, args: FeatureFlagSegmentArgs, opts?: CustomResourceOptions);@overload
def FeatureFlagSegment(resource_name: str,
args: FeatureFlagSegmentArgs,
opts: Optional[ResourceOptions] = None)
@overload
def FeatureFlagSegment(resource_name: str,
opts: Optional[ResourceOptions] = None,
project_id: Optional[str] = None,
slug: Optional[str] = None,
description: Optional[str] = None,
excludes: Optional[Sequence[FeatureFlagSegmentExcludeArgs]] = None,
hint: Optional[str] = None,
includes: Optional[Sequence[FeatureFlagSegmentIncludeArgs]] = None,
name: Optional[str] = None,
team_id: Optional[str] = None)func NewFeatureFlagSegment(ctx *Context, name string, args FeatureFlagSegmentArgs, opts ...ResourceOption) (*FeatureFlagSegment, error)public FeatureFlagSegment(string name, FeatureFlagSegmentArgs args, CustomResourceOptions? opts = null)
public FeatureFlagSegment(String name, FeatureFlagSegmentArgs args)
public FeatureFlagSegment(String name, FeatureFlagSegmentArgs args, CustomResourceOptions options)
type: vercel:FeatureFlagSegment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "vercel_feature_flag_segment" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args FeatureFlagSegmentArgs
- 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 FeatureFlagSegmentArgs
- 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 FeatureFlagSegmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args FeatureFlagSegmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args FeatureFlagSegmentArgs
- 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 featureFlagSegmentResource = new Vercel.FeatureFlagSegment("featureFlagSegmentResource", new()
{
ProjectId = "string",
Slug = "string",
Description = "string",
Excludes = new[]
{
new Vercel.Inputs.FeatureFlagSegmentExcludeArgs
{
Attribute = "string",
Entity = "string",
Values = new[]
{
"string",
},
},
},
Hint = "string",
Includes = new[]
{
new Vercel.Inputs.FeatureFlagSegmentIncludeArgs
{
Attribute = "string",
Entity = "string",
Values = new[]
{
"string",
},
},
},
Name = "string",
TeamId = "string",
});
example, err := vercel.NewFeatureFlagSegment(ctx, "featureFlagSegmentResource", &vercel.FeatureFlagSegmentArgs{
ProjectId: pulumi.String("string"),
Slug: pulumi.String("string"),
Description: pulumi.String("string"),
Excludes: vercel.FeatureFlagSegmentExcludeArray{
&vercel.FeatureFlagSegmentExcludeArgs{
Attribute: pulumi.String("string"),
Entity: pulumi.String("string"),
Values: pulumi.StringArray{
pulumi.String("string"),
},
},
},
Hint: pulumi.String("string"),
Includes: vercel.FeatureFlagSegmentIncludeArray{
&vercel.FeatureFlagSegmentIncludeArgs{
Attribute: pulumi.String("string"),
Entity: pulumi.String("string"),
Values: pulumi.StringArray{
pulumi.String("string"),
},
},
},
Name: pulumi.String("string"),
TeamId: pulumi.String("string"),
})
resource "vercel_feature_flag_segment" "featureFlagSegmentResource" {
lifecycle {
create_before_destroy = true
}
project_id = "string"
slug = "string"
description = "string"
excludes {
attribute = "string"
entity = "string"
values = ["string"]
}
hint = "string"
includes {
attribute = "string"
entity = "string"
values = ["string"]
}
name = "string"
team_id = "string"
}
var featureFlagSegmentResource = new FeatureFlagSegment("featureFlagSegmentResource", FeatureFlagSegmentArgs.builder()
.projectId("string")
.slug("string")
.description("string")
.excludes(FeatureFlagSegmentExcludeArgs.builder()
.attribute("string")
.entity("string")
.values("string")
.build())
.hint("string")
.includes(FeatureFlagSegmentIncludeArgs.builder()
.attribute("string")
.entity("string")
.values("string")
.build())
.name("string")
.teamId("string")
.build());
feature_flag_segment_resource = vercel.FeatureFlagSegment("featureFlagSegmentResource",
project_id="string",
slug="string",
description="string",
excludes=[{
"attribute": "string",
"entity": "string",
"values": ["string"],
}],
hint="string",
includes=[{
"attribute": "string",
"entity": "string",
"values": ["string"],
}],
name="string",
team_id="string")
const featureFlagSegmentResource = new vercel.FeatureFlagSegment("featureFlagSegmentResource", {
projectId: "string",
slug: "string",
description: "string",
excludes: [{
attribute: "string",
entity: "string",
values: ["string"],
}],
hint: "string",
includes: [{
attribute: "string",
entity: "string",
values: ["string"],
}],
name: "string",
teamId: "string",
});
type: vercel:FeatureFlagSegment
properties:
description: string
excludes:
- attribute: string
entity: string
values:
- string
hint: string
includes:
- attribute: string
entity: string
values:
- string
name: string
projectId: string
slug: string
teamId: string
FeatureFlagSegment 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 FeatureFlagSegment resource accepts the following input properties:
- Project
Id string - The ID of the Vercel project that owns the segment.
- Slug string
- The stable segment slug used by the Vercel Flags API.
- Description string
- A human-readable description of the segment.
- Excludes
List<Pulumiverse.
Vercel. Inputs. Feature Flag Segment Exclude> - Exact entity attribute values that should always be excluded from this segment.
- Hint string
- An optional dashboard hint for the segment.
- Includes
List<Pulumiverse.
Vercel. Inputs. Feature Flag Segment Include> - Exact entity attribute values that should always be part of this segment.
- Name string
- The human-readable segment name shown in the Vercel dashboard.
- 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.
- Project
Id string - The ID of the Vercel project that owns the segment.
- Slug string
- The stable segment slug used by the Vercel Flags API.
- Description string
- A human-readable description of the segment.
- Excludes
[]Feature
Flag Segment Exclude Args - Exact entity attribute values that should always be excluded from this segment.
- Hint string
- An optional dashboard hint for the segment.
- Includes
[]Feature
Flag Segment Include Args - Exact entity attribute values that should always be part of this segment.
- Name string
- The human-readable segment name shown in the Vercel dashboard.
- 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.
- project_
id string - The ID of the Vercel project that owns the segment.
- slug string
- The stable segment slug used by the Vercel Flags API.
- description string
- A human-readable description of the segment.
- excludes list(object)
- Exact entity attribute values that should always be excluded from this segment.
- hint string
- An optional dashboard hint for the segment.
- includes list(object)
- Exact entity attribute values that should always be part of this segment.
- name string
- The human-readable segment name shown in the Vercel dashboard.
- 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.
- project
Id String - The ID of the Vercel project that owns the segment.
- slug String
- The stable segment slug used by the Vercel Flags API.
- description String
- A human-readable description of the segment.
- excludes
List<Feature
Flag Segment Exclude> - Exact entity attribute values that should always be excluded from this segment.
- hint String
- An optional dashboard hint for the segment.
- includes
List<Feature
Flag Segment Include> - Exact entity attribute values that should always be part of this segment.
- name String
- The human-readable segment name shown in the Vercel dashboard.
- 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.
- project
Id string - The ID of the Vercel project that owns the segment.
- slug string
- The stable segment slug used by the Vercel Flags API.
- description string
- A human-readable description of the segment.
- excludes
Feature
Flag Segment Exclude[] - Exact entity attribute values that should always be excluded from this segment.
- hint string
- An optional dashboard hint for the segment.
- includes
Feature
Flag Segment Include[] - Exact entity attribute values that should always be part of this segment.
- name string
- The human-readable segment name shown in the Vercel dashboard.
- 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.
- project_
id str - The ID of the Vercel project that owns the segment.
- slug str
- The stable segment slug used by the Vercel Flags API.
- description str
- A human-readable description of the segment.
- excludes
Sequence[Feature
Flag Segment Exclude Args] - Exact entity attribute values that should always be excluded from this segment.
- hint str
- An optional dashboard hint for the segment.
- includes
Sequence[Feature
Flag Segment Include Args] - Exact entity attribute values that should always be part of this segment.
- name str
- The human-readable segment name shown in the Vercel dashboard.
- 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.
- project
Id String - The ID of the Vercel project that owns the segment.
- slug String
- The stable segment slug used by the Vercel Flags API.
- description String
- A human-readable description of the segment.
- excludes List<Property Map>
- Exact entity attribute values that should always be excluded from this segment.
- hint String
- An optional dashboard hint for the segment.
- includes List<Property Map>
- Exact entity attribute values that should always be part of this segment.
- name String
- The human-readable segment name shown in the Vercel dashboard.
- 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 FeatureFlagSegment 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 FeatureFlagSegment Resource
Get an existing FeatureFlagSegment 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?: FeatureFlagSegmentState, opts?: CustomResourceOptions): FeatureFlagSegment@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
excludes: Optional[Sequence[FeatureFlagSegmentExcludeArgs]] = None,
hint: Optional[str] = None,
includes: Optional[Sequence[FeatureFlagSegmentIncludeArgs]] = None,
name: Optional[str] = None,
project_id: Optional[str] = None,
slug: Optional[str] = None,
team_id: Optional[str] = None) -> FeatureFlagSegmentfunc GetFeatureFlagSegment(ctx *Context, name string, id IDInput, state *FeatureFlagSegmentState, opts ...ResourceOption) (*FeatureFlagSegment, error)public static FeatureFlagSegment Get(string name, Input<string> id, FeatureFlagSegmentState? state, CustomResourceOptions? opts = null)public static FeatureFlagSegment get(String name, Output<String> id, FeatureFlagSegmentState state, CustomResourceOptions options)resources: _: type: vercel:FeatureFlagSegment get: id: ${id}import {
to = vercel_feature_flag_segment.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.
- Description string
- A human-readable description of the segment.
- Excludes
List<Pulumiverse.
Vercel. Inputs. Feature Flag Segment Exclude> - Exact entity attribute values that should always be excluded from this segment.
- Hint string
- An optional dashboard hint for the segment.
- Includes
List<Pulumiverse.
Vercel. Inputs. Feature Flag Segment Include> - Exact entity attribute values that should always be part of this segment.
- Name string
- The human-readable segment name shown in the Vercel dashboard.
- Project
Id string - The ID of the Vercel project that owns the segment.
- Slug string
- The stable segment slug used by the Vercel Flags API.
- 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.
- Description string
- A human-readable description of the segment.
- Excludes
[]Feature
Flag Segment Exclude Args - Exact entity attribute values that should always be excluded from this segment.
- Hint string
- An optional dashboard hint for the segment.
- Includes
[]Feature
Flag Segment Include Args - Exact entity attribute values that should always be part of this segment.
- Name string
- The human-readable segment name shown in the Vercel dashboard.
- Project
Id string - The ID of the Vercel project that owns the segment.
- Slug string
- The stable segment slug used by the Vercel Flags API.
- 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.
- description string
- A human-readable description of the segment.
- excludes list(object)
- Exact entity attribute values that should always be excluded from this segment.
- hint string
- An optional dashboard hint for the segment.
- includes list(object)
- Exact entity attribute values that should always be part of this segment.
- name string
- The human-readable segment name shown in the Vercel dashboard.
- project_
id string - The ID of the Vercel project that owns the segment.
- slug string
- The stable segment slug used by the Vercel Flags API.
- 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.
- description String
- A human-readable description of the segment.
- excludes
List<Feature
Flag Segment Exclude> - Exact entity attribute values that should always be excluded from this segment.
- hint String
- An optional dashboard hint for the segment.
- includes
List<Feature
Flag Segment Include> - Exact entity attribute values that should always be part of this segment.
- name String
- The human-readable segment name shown in the Vercel dashboard.
- project
Id String - The ID of the Vercel project that owns the segment.
- slug String
- The stable segment slug used by the Vercel Flags API.
- 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.
- description string
- A human-readable description of the segment.
- excludes
Feature
Flag Segment Exclude[] - Exact entity attribute values that should always be excluded from this segment.
- hint string
- An optional dashboard hint for the segment.
- includes
Feature
Flag Segment Include[] - Exact entity attribute values that should always be part of this segment.
- name string
- The human-readable segment name shown in the Vercel dashboard.
- project
Id string - The ID of the Vercel project that owns the segment.
- slug string
- The stable segment slug used by the Vercel Flags API.
- 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.
- description str
- A human-readable description of the segment.
- excludes
Sequence[Feature
Flag Segment Exclude Args] - Exact entity attribute values that should always be excluded from this segment.
- hint str
- An optional dashboard hint for the segment.
- includes
Sequence[Feature
Flag Segment Include Args] - Exact entity attribute values that should always be part of this segment.
- name str
- The human-readable segment name shown in the Vercel dashboard.
- project_
id str - The ID of the Vercel project that owns the segment.
- slug str
- The stable segment slug used by the Vercel Flags API.
- 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.
- description String
- A human-readable description of the segment.
- excludes List<Property Map>
- Exact entity attribute values that should always be excluded from this segment.
- hint String
- An optional dashboard hint for the segment.
- includes List<Property Map>
- Exact entity attribute values that should always be part of this segment.
- name String
- The human-readable segment name shown in the Vercel dashboard.
- project
Id String - The ID of the Vercel project that owns the segment.
- slug String
- The stable segment slug used by the Vercel Flags API.
- 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.
Supporting Types
FeatureFlagSegmentExclude, FeatureFlagSegmentExcludeArgs
FeatureFlagSegmentInclude, FeatureFlagSegmentIncludeArgs
Import
The pulumi import command can be used, for example:
If importing into a personal account, or with a team configured on the provider, simply use the project ID and segment ID.
- project_id can be found in the project
settingstab in the Vercel UI. - segment_id can be found from the Flags API or by inspecting the segment in the Vercel UI.
$ pulumi import vercel:index/featureFlagSegment:FeatureFlagSegment example prj_xxxxxxxxxxxxxxxxxxxxxxxxxxxx/segment_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Alternatively, you can import via the team_id, project_id, and segment ID.
- team_id can be found in the team
settingstab in the Vercel UI. - project_id can be found in the project
settingstab in the Vercel UI.
$ pulumi import vercel:index/featureFlagSegment:FeatureFlagSegment example team_xxxxxxxxxxxxxxxxxxxxxxxx/prj_xxxxxxxxxxxxxxxxxxxxxxxxxxxx/segment_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
To learn more about importing existing cloud resources, see Importing resources.
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