1. Registry
  2. Packages
  3. Gitlab Provider
  4. API Docs
  5. ProjectFeatureFlag
Viewing docs for GitLab v10.2.0
published on Wednesday, Aug 26, 2026 by Pulumi
gitlab logo
Viewing docs for GitLab v10.2.0
published on Wednesday, Aug 26, 2026 by Pulumi

    The gitlab.ProjectFeatureFlag resource manages the lifecycle of a project-level feature flag.

    Feature flags allow you to progressively roll out features using different strategies (e.g. default, gradual rollout by user ID, or user lists).

    Upstream API: GitLab REST API docs

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gitlab from "@pulumi/gitlab";
    
    const example = new gitlab.Project("example", {
        name: "example",
        visibilityLevel: "private",
    });
    // Minimal example: a feature flag with no rollout strategies.
    const minimal = new gitlab.ProjectFeatureFlag("minimal", {
        project: example.id,
        name: "my_feature",
    });
    // Full example: a feature flag with a gradual rollout strategy.
    const exampleProjectFeatureFlag = new gitlab.ProjectFeatureFlag("example", {
        project: example.id,
        name: "gradual_rollout_feature",
        description: "Gradual rollout of the new checkout flow",
        active: true,
        strategies: [{
            name: "gradualRolloutUserId",
            parameters: {
                percentage: "50",
            },
            scopes: [{
                environmentScope: "production",
            }],
        }],
    });
    // Example targeting a fixed set of users via a gitlab_project_feature_flag_user_list.
    const betaTesters = new gitlab.ProjectFeatureFlagUserList("beta_testers", {
        project: example.id,
        name: "beta_testers",
        userXids: "user1,user2,user3",
    });
    const userListExample = new gitlab.ProjectFeatureFlag("user_list_example", {
        project: example.id,
        name: "user_list_feature",
        strategies: [{
            name: "gitlabUserList",
            userListId: betaTesters.listId,
        }],
    });
    
    import pulumi
    import pulumi_gitlab as gitlab
    
    example = gitlab.Project("example",
        name="example",
        visibility_level="private")
    # Minimal example: a feature flag with no rollout strategies.
    minimal = gitlab.ProjectFeatureFlag("minimal",
        project=example.id,
        name="my_feature")
    # Full example: a feature flag with a gradual rollout strategy.
    example_project_feature_flag = gitlab.ProjectFeatureFlag("example",
        project=example.id,
        name="gradual_rollout_feature",
        description="Gradual rollout of the new checkout flow",
        active=True,
        strategies=[{
            "name": "gradualRolloutUserId",
            "parameters": {
                "percentage": "50",
            },
            "scopes": [{
                "environment_scope": "production",
            }],
        }])
    # Example targeting a fixed set of users via a gitlab_project_feature_flag_user_list.
    beta_testers = gitlab.ProjectFeatureFlagUserList("beta_testers",
        project=example.id,
        name="beta_testers",
        user_xids="user1,user2,user3")
    user_list_example = gitlab.ProjectFeatureFlag("user_list_example",
        project=example.id,
        name="user_list_feature",
        strategies=[{
            "name": "gitlabUserList",
            "user_list_id": beta_testers.list_id,
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gitlab/sdk/v10/go/gitlab"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := gitlab.NewProject(ctx, "example", &gitlab.ProjectArgs{
    			Name:            pulumi.String("example"),
    			VisibilityLevel: pulumi.String("private"),
    		})
    		if err != nil {
    			return err
    		}
    		// Minimal example: a feature flag with no rollout strategies.
    		_, err = gitlab.NewProjectFeatureFlag(ctx, "minimal", &gitlab.ProjectFeatureFlagArgs{
    			Project: example.ID().ToIDOutput().ToStringOutput(),
    			Name:    pulumi.String("my_feature"),
    		})
    		if err != nil {
    			return err
    		}
    		// Full example: a feature flag with a gradual rollout strategy.
    		_, err = gitlab.NewProjectFeatureFlag(ctx, "example", &gitlab.ProjectFeatureFlagArgs{
    			Project:     example.ID().ToIDOutput().ToStringOutput(),
    			Name:        pulumi.String("gradual_rollout_feature"),
    			Description: pulumi.String("Gradual rollout of the new checkout flow"),
    			Active:      pulumi.Bool(true),
    			Strategies: gitlab.ProjectFeatureFlagStrategyArray{
    				&gitlab.ProjectFeatureFlagStrategyArgs{
    					Name: pulumi.String("gradualRolloutUserId"),
    					Parameters: &gitlab.ProjectFeatureFlagStrategyParametersArgs{
    						Percentage: pulumi.String("50"),
    					},
    					Scopes: gitlab.ProjectFeatureFlagStrategyScopeArray{
    						&gitlab.ProjectFeatureFlagStrategyScopeArgs{
    							EnvironmentScope: pulumi.String("production"),
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// Example targeting a fixed set of users via a gitlab_project_feature_flag_user_list.
    		betaTesters, err := gitlab.NewProjectFeatureFlagUserList(ctx, "beta_testers", &gitlab.ProjectFeatureFlagUserListArgs{
    			Project:  example.ID().ToIDOutput().ToStringOutput(),
    			Name:     pulumi.String("beta_testers"),
    			UserXids: pulumi.String("user1,user2,user3"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = gitlab.NewProjectFeatureFlag(ctx, "user_list_example", &gitlab.ProjectFeatureFlagArgs{
    			Project: example.ID().ToIDOutput().ToStringOutput(),
    			Name:    pulumi.String("user_list_feature"),
    			Strategies: gitlab.ProjectFeatureFlagStrategyArray{
    				&gitlab.ProjectFeatureFlagStrategyArgs{
    					Name:       pulumi.String("gitlabUserList"),
    					UserListId: betaTesters.ListId,
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using GitLab = Pulumi.GitLab;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new GitLab.Project("example", new()
        {
            Name = "example",
            VisibilityLevel = "private",
        });
    
        // Minimal example: a feature flag with no rollout strategies.
        var minimal = new GitLab.ProjectFeatureFlag("minimal", new()
        {
            Project = example.Id,
            Name = "my_feature",
        });
    
        // Full example: a feature flag with a gradual rollout strategy.
        var exampleProjectFeatureFlag = new GitLab.ProjectFeatureFlag("example", new()
        {
            Project = example.Id,
            Name = "gradual_rollout_feature",
            Description = "Gradual rollout of the new checkout flow",
            Active = true,
            Strategies = new[]
            {
                new GitLab.Inputs.ProjectFeatureFlagStrategyArgs
                {
                    Name = "gradualRolloutUserId",
                    Parameters = new GitLab.Inputs.ProjectFeatureFlagStrategyParametersArgs
                    {
                        Percentage = "50",
                    },
                    Scopes = new[]
                    {
                        new GitLab.Inputs.ProjectFeatureFlagStrategyScopeArgs
                        {
                            EnvironmentScope = "production",
                        },
                    },
                },
            },
        });
    
        // Example targeting a fixed set of users via a gitlab_project_feature_flag_user_list.
        var betaTesters = new GitLab.ProjectFeatureFlagUserList("beta_testers", new()
        {
            Project = example.Id,
            Name = "beta_testers",
            UserXids = "user1,user2,user3",
        });
    
        var userListExample = new GitLab.ProjectFeatureFlag("user_list_example", new()
        {
            Project = example.Id,
            Name = "user_list_feature",
            Strategies = new[]
            {
                new GitLab.Inputs.ProjectFeatureFlagStrategyArgs
                {
                    Name = "gitlabUserList",
                    UserListId = betaTesters.ListId,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gitlab.Project;
    import com.pulumi.gitlab.ProjectArgs;
    import com.pulumi.gitlab.ProjectFeatureFlag;
    import com.pulumi.gitlab.ProjectFeatureFlagArgs;
    import com.pulumi.gitlab.inputs.ProjectFeatureFlagStrategyArgs;
    import com.pulumi.gitlab.inputs.ProjectFeatureFlagStrategyParametersArgs;
    import com.pulumi.gitlab.inputs.ProjectFeatureFlagStrategyScopeArgs;
    import com.pulumi.gitlab.ProjectFeatureFlagUserList;
    import com.pulumi.gitlab.ProjectFeatureFlagUserListArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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("example")
                .visibilityLevel("private")
                .build());
    
            // Minimal example: a feature flag with no rollout strategies.
            var minimal = new ProjectFeatureFlag("minimal", ProjectFeatureFlagArgs.builder()
                .project(example.id())
                .name("my_feature")
                .build());
    
            // Full example: a feature flag with a gradual rollout strategy.
            var exampleProjectFeatureFlag = new ProjectFeatureFlag("exampleProjectFeatureFlag", ProjectFeatureFlagArgs.builder()
                .project(example.id())
                .name("gradual_rollout_feature")
                .description("Gradual rollout of the new checkout flow")
                .active(true)
                .strategies(ProjectFeatureFlagStrategyArgs.builder()
                    .name("gradualRolloutUserId")
                    .parameters(ProjectFeatureFlagStrategyParametersArgs.builder()
                        .percentage("50")
                        .build())
                    .scopes(ProjectFeatureFlagStrategyScopeArgs.builder()
                        .environmentScope("production")
                        .build())
                    .build())
                .build());
    
            // Example targeting a fixed set of users via a gitlab_project_feature_flag_user_list.
            var betaTesters = new ProjectFeatureFlagUserList("betaTesters", ProjectFeatureFlagUserListArgs.builder()
                .project(example.id())
                .name("beta_testers")
                .userXids("user1,user2,user3")
                .build());
    
            var userListExample = new ProjectFeatureFlag("userListExample", ProjectFeatureFlagArgs.builder()
                .project(example.id())
                .name("user_list_feature")
                .strategies(ProjectFeatureFlagStrategyArgs.builder()
                    .name("gitlabUserList")
                    .userListId(betaTesters.listId())
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: gitlab:Project
        properties:
          name: example
          visibilityLevel: private
      # Minimal example: a feature flag with no rollout strategies.
      minimal:
        type: gitlab:ProjectFeatureFlag
        properties:
          project: ${example.id}
          name: my_feature
      # Full example: a feature flag with a gradual rollout strategy.
      exampleProjectFeatureFlag:
        type: gitlab:ProjectFeatureFlag
        name: example
        properties:
          project: ${example.id}
          name: gradual_rollout_feature
          description: Gradual rollout of the new checkout flow
          active: true
          strategies:
            - name: gradualRolloutUserId
              parameters:
                percentage: '50'
              scopes:
                - environmentScope: production
      # Example targeting a fixed set of users via a gitlab_project_feature_flag_user_list.
      betaTesters:
        type: gitlab:ProjectFeatureFlagUserList
        name: beta_testers
        properties:
          project: ${example.id}
          name: beta_testers
          userXids: user1,user2,user3
      userListExample:
        type: gitlab:ProjectFeatureFlag
        name: user_list_example
        properties:
          project: ${example.id}
          name: user_list_feature
          strategies:
            - name: gitlabUserList
              userListId: ${betaTesters.listId}
    
    pulumi {
      required_providers {
        gitlab = {
          source = "pulumi/gitlab"
        }
      }
    }
    
    resource "gitlab_project" "example" {
      name             = "example"
      visibility_level = "private"
    }
    # Minimal example: a feature flag with no rollout strategies.
    resource "gitlab_projectfeatureflag" "minimal" {
      project = gitlab_project.example.id
      name    = "my_feature"
    }
    # Full example: a feature flag with a gradual rollout strategy.
    resource "gitlab_projectfeatureflag" "example" {
      project     = gitlab_project.example.id
      name        = "gradual_rollout_feature"
      description = "Gradual rollout of the new checkout flow"
      active      = true
      strategies {
        name = "gradualRolloutUserId"
        parameters = {
          percentage = "50"
        }
        scopes {
          environment_scope = "production"
        }
      }
    }
    # Example targeting a fixed set of users via a gitlab_project_feature_flag_user_list.
    resource "gitlab_projectfeatureflaguserlist" "beta_testers" {
      project   = gitlab_project.example.id
      name      = "beta_testers"
      user_xids = "user1,user2,user3"
    }
    resource "gitlab_projectfeatureflag" "user_list_example" {
      project = gitlab_project.example.id
      name    = "user_list_feature"
      strategies {
        name         = "gitlabUserList"
        user_list_id = gitlab_projectfeatureflaguserlist.beta_testers.list_id
      }
    }
    

    Create ProjectFeatureFlag Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ProjectFeatureFlag(name: string, args: ProjectFeatureFlagArgs, opts?: CustomResourceOptions);
    @overload
    def ProjectFeatureFlag(resource_name: str,
                           args: ProjectFeatureFlagArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def ProjectFeatureFlag(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           project: Optional[str] = None,
                           active: Optional[bool] = None,
                           description: Optional[str] = None,
                           name: Optional[str] = None,
                           strategies: Optional[Sequence[ProjectFeatureFlagStrategyArgs]] = None)
    func NewProjectFeatureFlag(ctx *Context, name string, args ProjectFeatureFlagArgs, opts ...ResourceOption) (*ProjectFeatureFlag, error)
    public ProjectFeatureFlag(string name, ProjectFeatureFlagArgs args, CustomResourceOptions? opts = null)
    public ProjectFeatureFlag(String name, ProjectFeatureFlagArgs args)
    public ProjectFeatureFlag(String name, ProjectFeatureFlagArgs args, CustomResourceOptions options)
    
    type: gitlab:ProjectFeatureFlag
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "gitlab_project_feature_flag" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args ProjectFeatureFlagArgs
    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 ProjectFeatureFlagArgs
    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 ProjectFeatureFlagArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ProjectFeatureFlagArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ProjectFeatureFlagArgs
    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 projectFeatureFlagResource = new GitLab.ProjectFeatureFlag("projectFeatureFlagResource", new()
    {
        Project = "string",
        Active = false,
        Description = "string",
        Name = "string",
        Strategies = new[]
        {
            new GitLab.Inputs.ProjectFeatureFlagStrategyArgs
            {
                Name = "string",
                Parameters = new GitLab.Inputs.ProjectFeatureFlagStrategyParametersArgs
                {
                    GroupId = "string",
                    Percentage = "string",
                    Rollout = "string",
                    Stickiness = "string",
                    UserIds = "string",
                },
                Scopes = new[]
                {
                    new GitLab.Inputs.ProjectFeatureFlagStrategyScopeArgs
                    {
                        EnvironmentScope = "string",
                    },
                },
                UserListId = 0,
            },
        },
    });
    
    example, err := gitlab.NewProjectFeatureFlag(ctx, "projectFeatureFlagResource", &gitlab.ProjectFeatureFlagArgs{
    	Project:     pulumi.String("string"),
    	Active:      pulumi.Bool(false),
    	Description: pulumi.String("string"),
    	Name:        pulumi.String("string"),
    	Strategies: gitlab.ProjectFeatureFlagStrategyArray{
    		&gitlab.ProjectFeatureFlagStrategyArgs{
    			Name: pulumi.String("string"),
    			Parameters: &gitlab.ProjectFeatureFlagStrategyParametersArgs{
    				GroupId:    pulumi.String("string"),
    				Percentage: pulumi.String("string"),
    				Rollout:    pulumi.String("string"),
    				Stickiness: pulumi.String("string"),
    				UserIds:    pulumi.String("string"),
    			},
    			Scopes: gitlab.ProjectFeatureFlagStrategyScopeArray{
    				&gitlab.ProjectFeatureFlagStrategyScopeArgs{
    					EnvironmentScope: pulumi.String("string"),
    				},
    			},
    			UserListId: pulumi.Int(0),
    		},
    	},
    })
    
    resource "gitlab_project_feature_flag" "projectFeatureFlagResource" {
      lifecycle {
        create_before_destroy = true
      }
      project     = "string"
      active      = false
      description = "string"
      name        = "string"
      strategies {
        name = "string"
        parameters = {
          group_id   = "string"
          percentage = "string"
          rollout    = "string"
          stickiness = "string"
          user_ids   = "string"
        }
        scopes {
          environment_scope = "string"
        }
        user_list_id = 0
      }
    }
    
    var projectFeatureFlagResource = new ProjectFeatureFlag("projectFeatureFlagResource", ProjectFeatureFlagArgs.builder()
        .project("string")
        .active(false)
        .description("string")
        .name("string")
        .strategies(ProjectFeatureFlagStrategyArgs.builder()
            .name("string")
            .parameters(ProjectFeatureFlagStrategyParametersArgs.builder()
                .groupId("string")
                .percentage("string")
                .rollout("string")
                .stickiness("string")
                .userIds("string")
                .build())
            .scopes(ProjectFeatureFlagStrategyScopeArgs.builder()
                .environmentScope("string")
                .build())
            .userListId(0)
            .build())
        .build());
    
    project_feature_flag_resource = gitlab.ProjectFeatureFlag("projectFeatureFlagResource",
        project="string",
        active=False,
        description="string",
        name="string",
        strategies=[{
            "name": "string",
            "parameters": {
                "group_id": "string",
                "percentage": "string",
                "rollout": "string",
                "stickiness": "string",
                "user_ids": "string",
            },
            "scopes": [{
                "environment_scope": "string",
            }],
            "user_list_id": 0,
        }])
    
    const projectFeatureFlagResource = new gitlab.ProjectFeatureFlag("projectFeatureFlagResource", {
        project: "string",
        active: false,
        description: "string",
        name: "string",
        strategies: [{
            name: "string",
            parameters: {
                groupId: "string",
                percentage: "string",
                rollout: "string",
                stickiness: "string",
                userIds: "string",
            },
            scopes: [{
                environmentScope: "string",
            }],
            userListId: 0,
        }],
    });
    
    type: gitlab:ProjectFeatureFlag
    properties:
        active: false
        description: string
        name: string
        project: string
        strategies:
            - name: string
              parameters:
                groupId: string
                percentage: string
                rollout: string
                stickiness: string
                userIds: string
              scopes:
                - environmentScope: string
              userListId: 0
    

    ProjectFeatureFlag 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 ProjectFeatureFlag resource accepts the following input properties:

    Project string
    The ID or URL-encoded path of the project.
    Active bool
    Whether the feature flag is active. Defaults to true.
    Description string
    The description of the feature flag.
    Name string
    The name of the feature flag.
    Strategies List<Pulumi.GitLab.Inputs.ProjectFeatureFlagStrategy>
    A set of feature flag strategies. Updating this set replaces every strategy it previously managed in a single API call: strategies no longer present are removed (via the GitLab API's _destroy flag) and the rest are recreated, but the feature flag itself (name, description, active, createdAt) is left untouched. Leaving strategies unconfigured (the default) leaves any existing strategies - including gitlabUserList bindings made outside of Terraform - alone.
    Project string
    The ID or URL-encoded path of the project.
    Active bool
    Whether the feature flag is active. Defaults to true.
    Description string
    The description of the feature flag.
    Name string
    The name of the feature flag.
    Strategies []ProjectFeatureFlagStrategyArgs
    A set of feature flag strategies. Updating this set replaces every strategy it previously managed in a single API call: strategies no longer present are removed (via the GitLab API's _destroy flag) and the rest are recreated, but the feature flag itself (name, description, active, createdAt) is left untouched. Leaving strategies unconfigured (the default) leaves any existing strategies - including gitlabUserList bindings made outside of Terraform - alone.
    project string
    The ID or URL-encoded path of the project.
    active bool
    Whether the feature flag is active. Defaults to true.
    description string
    The description of the feature flag.
    name string
    The name of the feature flag.
    strategies list(object)
    A set of feature flag strategies. Updating this set replaces every strategy it previously managed in a single API call: strategies no longer present are removed (via the GitLab API's _destroy flag) and the rest are recreated, but the feature flag itself (name, description, active, createdAt) is left untouched. Leaving strategies unconfigured (the default) leaves any existing strategies - including gitlabUserList bindings made outside of Terraform - alone.
    project String
    The ID or URL-encoded path of the project.
    active Boolean
    Whether the feature flag is active. Defaults to true.
    description String
    The description of the feature flag.
    name String
    The name of the feature flag.
    strategies List<ProjectFeatureFlagStrategy>
    A set of feature flag strategies. Updating this set replaces every strategy it previously managed in a single API call: strategies no longer present are removed (via the GitLab API's _destroy flag) and the rest are recreated, but the feature flag itself (name, description, active, createdAt) is left untouched. Leaving strategies unconfigured (the default) leaves any existing strategies - including gitlabUserList bindings made outside of Terraform - alone.
    project string
    The ID or URL-encoded path of the project.
    active boolean
    Whether the feature flag is active. Defaults to true.
    description string
    The description of the feature flag.
    name string
    The name of the feature flag.
    strategies ProjectFeatureFlagStrategy[]
    A set of feature flag strategies. Updating this set replaces every strategy it previously managed in a single API call: strategies no longer present are removed (via the GitLab API's _destroy flag) and the rest are recreated, but the feature flag itself (name, description, active, createdAt) is left untouched. Leaving strategies unconfigured (the default) leaves any existing strategies - including gitlabUserList bindings made outside of Terraform - alone.
    project str
    The ID or URL-encoded path of the project.
    active bool
    Whether the feature flag is active. Defaults to true.
    description str
    The description of the feature flag.
    name str
    The name of the feature flag.
    strategies Sequence[ProjectFeatureFlagStrategyArgs]
    A set of feature flag strategies. Updating this set replaces every strategy it previously managed in a single API call: strategies no longer present are removed (via the GitLab API's _destroy flag) and the rest are recreated, but the feature flag itself (name, description, active, createdAt) is left untouched. Leaving strategies unconfigured (the default) leaves any existing strategies - including gitlabUserList bindings made outside of Terraform - alone.
    project String
    The ID or URL-encoded path of the project.
    active Boolean
    Whether the feature flag is active. Defaults to true.
    description String
    The description of the feature flag.
    name String
    The name of the feature flag.
    strategies List<Property Map>
    A set of feature flag strategies. Updating this set replaces every strategy it previously managed in a single API call: strategies no longer present are removed (via the GitLab API's _destroy flag) and the rest are recreated, but the feature flag itself (name, description, active, createdAt) is left untouched. Leaving strategies unconfigured (the default) leaves any existing strategies - including gitlabUserList bindings made outside of Terraform - alone.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ProjectFeatureFlag resource produces the following output properties:

    CreatedAt string
    The date and time the feature flag was created, in ISO 8601 format.
    Id string
    The provider-assigned unique ID for this managed resource.
    CreatedAt string
    The date and time the feature flag was created, in ISO 8601 format.
    Id string
    The provider-assigned unique ID for this managed resource.
    created_at string
    The date and time the feature flag was created, in ISO 8601 format.
    id string
    The provider-assigned unique ID for this managed resource.
    createdAt String
    The date and time the feature flag was created, in ISO 8601 format.
    id String
    The provider-assigned unique ID for this managed resource.
    createdAt string
    The date and time the feature flag was created, in ISO 8601 format.
    id string
    The provider-assigned unique ID for this managed resource.
    created_at str
    The date and time the feature flag was created, in ISO 8601 format.
    id str
    The provider-assigned unique ID for this managed resource.
    createdAt String
    The date and time the feature flag was created, in ISO 8601 format.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ProjectFeatureFlag Resource

    Get an existing ProjectFeatureFlag 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?: ProjectFeatureFlagState, opts?: CustomResourceOptions): ProjectFeatureFlag
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            active: Optional[bool] = None,
            created_at: Optional[str] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            project: Optional[str] = None,
            strategies: Optional[Sequence[ProjectFeatureFlagStrategyArgs]] = None) -> ProjectFeatureFlag
    func GetProjectFeatureFlag(ctx *Context, name string, id IDInput, state *ProjectFeatureFlagState, opts ...ResourceOption) (*ProjectFeatureFlag, error)
    public static ProjectFeatureFlag Get(string name, Input<string> id, ProjectFeatureFlagState? state, CustomResourceOptions? opts = null)
    public static ProjectFeatureFlag get(String name, Output<String> id, ProjectFeatureFlagState state, CustomResourceOptions options)
    resources:  _:    type: gitlab:ProjectFeatureFlag    get:      id: ${id}
    import {
      to = gitlab_project_feature_flag.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.
    The following state arguments are supported:
    Active bool
    Whether the feature flag is active. Defaults to true.
    CreatedAt string
    The date and time the feature flag was created, in ISO 8601 format.
    Description string
    The description of the feature flag.
    Name string
    The name of the feature flag.
    Project string
    The ID or URL-encoded path of the project.
    Strategies List<Pulumi.GitLab.Inputs.ProjectFeatureFlagStrategy>
    A set of feature flag strategies. Updating this set replaces every strategy it previously managed in a single API call: strategies no longer present are removed (via the GitLab API's _destroy flag) and the rest are recreated, but the feature flag itself (name, description, active, createdAt) is left untouched. Leaving strategies unconfigured (the default) leaves any existing strategies - including gitlabUserList bindings made outside of Terraform - alone.
    Active bool
    Whether the feature flag is active. Defaults to true.
    CreatedAt string
    The date and time the feature flag was created, in ISO 8601 format.
    Description string
    The description of the feature flag.
    Name string
    The name of the feature flag.
    Project string
    The ID or URL-encoded path of the project.
    Strategies []ProjectFeatureFlagStrategyArgs
    A set of feature flag strategies. Updating this set replaces every strategy it previously managed in a single API call: strategies no longer present are removed (via the GitLab API's _destroy flag) and the rest are recreated, but the feature flag itself (name, description, active, createdAt) is left untouched. Leaving strategies unconfigured (the default) leaves any existing strategies - including gitlabUserList bindings made outside of Terraform - alone.
    active bool
    Whether the feature flag is active. Defaults to true.
    created_at string
    The date and time the feature flag was created, in ISO 8601 format.
    description string
    The description of the feature flag.
    name string
    The name of the feature flag.
    project string
    The ID or URL-encoded path of the project.
    strategies list(object)
    A set of feature flag strategies. Updating this set replaces every strategy it previously managed in a single API call: strategies no longer present are removed (via the GitLab API's _destroy flag) and the rest are recreated, but the feature flag itself (name, description, active, createdAt) is left untouched. Leaving strategies unconfigured (the default) leaves any existing strategies - including gitlabUserList bindings made outside of Terraform - alone.
    active Boolean
    Whether the feature flag is active. Defaults to true.
    createdAt String
    The date and time the feature flag was created, in ISO 8601 format.
    description String
    The description of the feature flag.
    name String
    The name of the feature flag.
    project String
    The ID or URL-encoded path of the project.
    strategies List<ProjectFeatureFlagStrategy>
    A set of feature flag strategies. Updating this set replaces every strategy it previously managed in a single API call: strategies no longer present are removed (via the GitLab API's _destroy flag) and the rest are recreated, but the feature flag itself (name, description, active, createdAt) is left untouched. Leaving strategies unconfigured (the default) leaves any existing strategies - including gitlabUserList bindings made outside of Terraform - alone.
    active boolean
    Whether the feature flag is active. Defaults to true.
    createdAt string
    The date and time the feature flag was created, in ISO 8601 format.
    description string
    The description of the feature flag.
    name string
    The name of the feature flag.
    project string
    The ID or URL-encoded path of the project.
    strategies ProjectFeatureFlagStrategy[]
    A set of feature flag strategies. Updating this set replaces every strategy it previously managed in a single API call: strategies no longer present are removed (via the GitLab API's _destroy flag) and the rest are recreated, but the feature flag itself (name, description, active, createdAt) is left untouched. Leaving strategies unconfigured (the default) leaves any existing strategies - including gitlabUserList bindings made outside of Terraform - alone.
    active bool
    Whether the feature flag is active. Defaults to true.
    created_at str
    The date and time the feature flag was created, in ISO 8601 format.
    description str
    The description of the feature flag.
    name str
    The name of the feature flag.
    project str
    The ID or URL-encoded path of the project.
    strategies Sequence[ProjectFeatureFlagStrategyArgs]
    A set of feature flag strategies. Updating this set replaces every strategy it previously managed in a single API call: strategies no longer present are removed (via the GitLab API's _destroy flag) and the rest are recreated, but the feature flag itself (name, description, active, createdAt) is left untouched. Leaving strategies unconfigured (the default) leaves any existing strategies - including gitlabUserList bindings made outside of Terraform - alone.
    active Boolean
    Whether the feature flag is active. Defaults to true.
    createdAt String
    The date and time the feature flag was created, in ISO 8601 format.
    description String
    The description of the feature flag.
    name String
    The name of the feature flag.
    project String
    The ID or URL-encoded path of the project.
    strategies List<Property Map>
    A set of feature flag strategies. Updating this set replaces every strategy it previously managed in a single API call: strategies no longer present are removed (via the GitLab API's _destroy flag) and the rest are recreated, but the feature flag itself (name, description, active, createdAt) is left untouched. Leaving strategies unconfigured (the default) leaves any existing strategies - including gitlabUserList bindings made outside of Terraform - alone.

    Supporting Types

    ProjectFeatureFlagStrategy, ProjectFeatureFlagStrategyArgs

    Name string
    The name of the strategy. Valid values are: default, gradualRolloutUserId, userWithId, flexibleRollout, gitlabUserList.
    Parameters Pulumi.GitLab.Inputs.ProjectFeatureFlagStrategyParameters
    Parameters for the strategy. Required fields depend on the strategy name:

    • gradualRolloutUserId: set percentage (required); groupId defaults to "default" if omitted.
    • userWithId: set userIds (required, comma-separated).
    • flexibleRollout: set rollout, group_id, and stickiness.
    Scopes List<Pulumi.GitLab.Inputs.ProjectFeatureFlagStrategyScope>
    Scopes define which environments the strategy applies to.
    UserListId int
    The ID of the gitlab.ProjectFeatureFlagUserList to bind to this strategy (its listId attribute, not iid). Required when name is gitlabUserList, and not usable otherwise.
    Name string
    The name of the strategy. Valid values are: default, gradualRolloutUserId, userWithId, flexibleRollout, gitlabUserList.
    Parameters ProjectFeatureFlagStrategyParameters
    Parameters for the strategy. Required fields depend on the strategy name:

    • gradualRolloutUserId: set percentage (required); groupId defaults to "default" if omitted.
    • userWithId: set userIds (required, comma-separated).
    • flexibleRollout: set rollout, group_id, and stickiness.
    Scopes []ProjectFeatureFlagStrategyScope
    Scopes define which environments the strategy applies to.
    UserListId int
    The ID of the gitlab.ProjectFeatureFlagUserList to bind to this strategy (its listId attribute, not iid). Required when name is gitlabUserList, and not usable otherwise.
    name string
    The name of the strategy. Valid values are: default, gradualRolloutUserId, userWithId, flexibleRollout, gitlabUserList.
    parameters object
    Parameters for the strategy. Required fields depend on the strategy name:

    • gradualRolloutUserId: set percentage (required); groupId defaults to "default" if omitted.
    • userWithId: set userIds (required, comma-separated).
    • flexibleRollout: set rollout, group_id, and stickiness.
    scopes list(object)
    Scopes define which environments the strategy applies to.
    user_list_id number
    The ID of the gitlab.ProjectFeatureFlagUserList to bind to this strategy (its listId attribute, not iid). Required when name is gitlabUserList, and not usable otherwise.
    name String
    The name of the strategy. Valid values are: default, gradualRolloutUserId, userWithId, flexibleRollout, gitlabUserList.
    parameters ProjectFeatureFlagStrategyParameters
    Parameters for the strategy. Required fields depend on the strategy name:

    • gradualRolloutUserId: set percentage (required); groupId defaults to "default" if omitted.
    • userWithId: set userIds (required, comma-separated).
    • flexibleRollout: set rollout, group_id, and stickiness.
    scopes List<ProjectFeatureFlagStrategyScope>
    Scopes define which environments the strategy applies to.
    userListId Integer
    The ID of the gitlab.ProjectFeatureFlagUserList to bind to this strategy (its listId attribute, not iid). Required when name is gitlabUserList, and not usable otherwise.
    name string
    The name of the strategy. Valid values are: default, gradualRolloutUserId, userWithId, flexibleRollout, gitlabUserList.
    parameters ProjectFeatureFlagStrategyParameters
    Parameters for the strategy. Required fields depend on the strategy name:

    • gradualRolloutUserId: set percentage (required); groupId defaults to "default" if omitted.
    • userWithId: set userIds (required, comma-separated).
    • flexibleRollout: set rollout, group_id, and stickiness.
    scopes ProjectFeatureFlagStrategyScope[]
    Scopes define which environments the strategy applies to.
    userListId number
    The ID of the gitlab.ProjectFeatureFlagUserList to bind to this strategy (its listId attribute, not iid). Required when name is gitlabUserList, and not usable otherwise.
    name str
    The name of the strategy. Valid values are: default, gradualRolloutUserId, userWithId, flexibleRollout, gitlabUserList.
    parameters ProjectFeatureFlagStrategyParameters
    Parameters for the strategy. Required fields depend on the strategy name:

    • gradualRolloutUserId: set percentage (required); groupId defaults to "default" if omitted.
    • userWithId: set userIds (required, comma-separated).
    • flexibleRollout: set rollout, group_id, and stickiness.
    scopes Sequence[ProjectFeatureFlagStrategyScope]
    Scopes define which environments the strategy applies to.
    user_list_id int
    The ID of the gitlab.ProjectFeatureFlagUserList to bind to this strategy (its listId attribute, not iid). Required when name is gitlabUserList, and not usable otherwise.
    name String
    The name of the strategy. Valid values are: default, gradualRolloutUserId, userWithId, flexibleRollout, gitlabUserList.
    parameters Property Map
    Parameters for the strategy. Required fields depend on the strategy name:

    • gradualRolloutUserId: set percentage (required); groupId defaults to "default" if omitted.
    • userWithId: set userIds (required, comma-separated).
    • flexibleRollout: set rollout, group_id, and stickiness.
    scopes List<Property Map>
    Scopes define which environments the strategy applies to.
    userListId Number
    The ID of the gitlab.ProjectFeatureFlagUserList to bind to this strategy (its listId attribute, not iid). Required when name is gitlabUserList, and not usable otherwise.

    ProjectFeatureFlagStrategyParameters, ProjectFeatureFlagStrategyParametersArgs

    GroupId string
    The Unleash group ID. Used by gradualRolloutUserId and flexibleRollout. Computed when omitted.
    Percentage string
    Percentage (as a string) of users to activate. Used by gradualRolloutUserId and flexibleRollout.
    Rollout string
    Rollout percentage for flexibleRollout.
    Stickiness string
    Stickiness setting for flexibleRollout. Computed when omitted.
    UserIds string
    Comma-separated list of user IDs. Used by userWithId.
    GroupId string
    The Unleash group ID. Used by gradualRolloutUserId and flexibleRollout. Computed when omitted.
    Percentage string
    Percentage (as a string) of users to activate. Used by gradualRolloutUserId and flexibleRollout.
    Rollout string
    Rollout percentage for flexibleRollout.
    Stickiness string
    Stickiness setting for flexibleRollout. Computed when omitted.
    UserIds string
    Comma-separated list of user IDs. Used by userWithId.
    group_id string
    The Unleash group ID. Used by gradualRolloutUserId and flexibleRollout. Computed when omitted.
    percentage string
    Percentage (as a string) of users to activate. Used by gradualRolloutUserId and flexibleRollout.
    rollout string
    Rollout percentage for flexibleRollout.
    stickiness string
    Stickiness setting for flexibleRollout. Computed when omitted.
    user_ids string
    Comma-separated list of user IDs. Used by userWithId.
    groupId String
    The Unleash group ID. Used by gradualRolloutUserId and flexibleRollout. Computed when omitted.
    percentage String
    Percentage (as a string) of users to activate. Used by gradualRolloutUserId and flexibleRollout.
    rollout String
    Rollout percentage for flexibleRollout.
    stickiness String
    Stickiness setting for flexibleRollout. Computed when omitted.
    userIds String
    Comma-separated list of user IDs. Used by userWithId.
    groupId string
    The Unleash group ID. Used by gradualRolloutUserId and flexibleRollout. Computed when omitted.
    percentage string
    Percentage (as a string) of users to activate. Used by gradualRolloutUserId and flexibleRollout.
    rollout string
    Rollout percentage for flexibleRollout.
    stickiness string
    Stickiness setting for flexibleRollout. Computed when omitted.
    userIds string
    Comma-separated list of user IDs. Used by userWithId.
    group_id str
    The Unleash group ID. Used by gradualRolloutUserId and flexibleRollout. Computed when omitted.
    percentage str
    Percentage (as a string) of users to activate. Used by gradualRolloutUserId and flexibleRollout.
    rollout str
    Rollout percentage for flexibleRollout.
    stickiness str
    Stickiness setting for flexibleRollout. Computed when omitted.
    user_ids str
    Comma-separated list of user IDs. Used by userWithId.
    groupId String
    The Unleash group ID. Used by gradualRolloutUserId and flexibleRollout. Computed when omitted.
    percentage String
    Percentage (as a string) of users to activate. Used by gradualRolloutUserId and flexibleRollout.
    rollout String
    Rollout percentage for flexibleRollout.
    stickiness String
    Stickiness setting for flexibleRollout. Computed when omitted.
    userIds String
    Comma-separated list of user IDs. Used by userWithId.

    ProjectFeatureFlagStrategyScope, ProjectFeatureFlagStrategyScopeArgs

    EnvironmentScope string
    The environment scope, e.g. *, production, staging.
    EnvironmentScope string
    The environment scope, e.g. *, production, staging.
    environment_scope string
    The environment scope, e.g. *, production, staging.
    environmentScope String
    The environment scope, e.g. *, production, staging.
    environmentScope string
    The environment scope, e.g. *, production, staging.
    environment_scope str
    The environment scope, e.g. *, production, staging.
    environmentScope String
    The environment scope, e.g. *, production, staging.

    Import

    Starting in Terraform v1.5.0, you can use an import block to import gitlab.ProjectFeatureFlag. For example:

    Importing using the CLI is supported with the following syntax:

    A GitLab Project Feature Flag can be imported using a key composed of <project>:<feature-flag-name>, e.g.

    $ pulumi import gitlab:index/projectFeatureFlag:ProjectFeatureFlag example "12345:my_feature"
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    GitLab pulumi/pulumi-gitlab
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the gitlab Terraform Provider.
    gitlab logo
    Viewing docs for GitLab v10.2.0
    published on Wednesday, Aug 26, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial