launchdarkly logo
Launch Darkly v0.0.6, Feb 19 23

launchdarkly.FeatureFlag

Explore with Pulumi AI

Provides a LaunchDarkly feature flag resource.

This resource allows you to create and manage feature flags within your LaunchDarkly organization.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Launchdarkly = Lbrlabs.PulumiPackage.Launchdarkly;

return await Deployment.RunAsync(() => 
{
    var buildingMaterials = new Launchdarkly.FeatureFlag("buildingMaterials", new()
    {
        ProjectKey = launchdarkly_project.Example.Key,
        Key = "building-materials",
        Description = "this is a multivariate flag with string variations.",
        VariationType = "string",
        Variations = new[]
        {
            new Launchdarkly.Inputs.FeatureFlagVariationArgs
            {
                Value = "straw",
                Name = "Straw",
                Description = "Watch out for wind.",
            },
            new Launchdarkly.Inputs.FeatureFlagVariationArgs
            {
                Value = "sticks",
                Name = "Sticks",
                Description = "Sturdier than straw",
            },
            new Launchdarkly.Inputs.FeatureFlagVariationArgs
            {
                Value = "bricks",
                Name = "Bricks",
                Description = "The strongest variation",
            },
        },
        Defaults = new Launchdarkly.Inputs.FeatureFlagDefaultsArgs
        {
            OnVariation = 2,
            OffVariation = 0,
        },
        Tags = new[]
        {
            "example",
            "terraform",
            "multivariate",
            "building-materials",
        },
    });

});
package main

import (
	"github.com/lbrlabs/pulumi-launchdarkly/sdk/go/launchdarkly"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := launchdarkly.NewFeatureFlag(ctx, "buildingMaterials", &launchdarkly.FeatureFlagArgs{
			ProjectKey:    pulumi.Any(launchdarkly_project.Example.Key),
			Key:           pulumi.String("building-materials"),
			Description:   pulumi.String("this is a multivariate flag with string variations."),
			VariationType: pulumi.String("string"),
			Variations: launchdarkly.FeatureFlagVariationArray{
				&launchdarkly.FeatureFlagVariationArgs{
					Value:       pulumi.String("straw"),
					Name:        pulumi.String("Straw"),
					Description: pulumi.String("Watch out for wind."),
				},
				&launchdarkly.FeatureFlagVariationArgs{
					Value:       pulumi.String("sticks"),
					Name:        pulumi.String("Sticks"),
					Description: pulumi.String("Sturdier than straw"),
				},
				&launchdarkly.FeatureFlagVariationArgs{
					Value:       pulumi.String("bricks"),
					Name:        pulumi.String("Bricks"),
					Description: pulumi.String("The strongest variation"),
				},
			},
			Defaults: &launchdarkly.FeatureFlagDefaultsArgs{
				OnVariation:  pulumi.Int(2),
				OffVariation: pulumi.Int(0),
			},
			Tags: pulumi.StringArray{
				pulumi.String("example"),
				pulumi.String("terraform"),
				pulumi.String("multivariate"),
				pulumi.String("building-materials"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.launchdarkly.FeatureFlag;
import com.pulumi.launchdarkly.FeatureFlagArgs;
import com.pulumi.launchdarkly.inputs.FeatureFlagVariationArgs;
import com.pulumi.launchdarkly.inputs.FeatureFlagDefaultsArgs;
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 buildingMaterials = new FeatureFlag("buildingMaterials", FeatureFlagArgs.builder()        
            .projectKey(launchdarkly_project.example().key())
            .key("building-materials")
            .description("this is a multivariate flag with string variations.")
            .variationType("string")
            .variations(            
                FeatureFlagVariationArgs.builder()
                    .value("straw")
                    .name("Straw")
                    .description("Watch out for wind.")
                    .build(),
                FeatureFlagVariationArgs.builder()
                    .value("sticks")
                    .name("Sticks")
                    .description("Sturdier than straw")
                    .build(),
                FeatureFlagVariationArgs.builder()
                    .value("bricks")
                    .name("Bricks")
                    .description("The strongest variation")
                    .build())
            .defaults(FeatureFlagDefaultsArgs.builder()
                .onVariation(2)
                .offVariation(0)
                .build())
            .tags(            
                "example",
                "terraform",
                "multivariate",
                "building-materials")
            .build());

    }
}
import pulumi
import lbrlabs_pulumi_launchdarkly as launchdarkly

building_materials = launchdarkly.FeatureFlag("buildingMaterials",
    project_key=launchdarkly_project["example"]["key"],
    key="building-materials",
    description="this is a multivariate flag with string variations.",
    variation_type="string",
    variations=[
        launchdarkly.FeatureFlagVariationArgs(
            value="straw",
            name="Straw",
            description="Watch out for wind.",
        ),
        launchdarkly.FeatureFlagVariationArgs(
            value="sticks",
            name="Sticks",
            description="Sturdier than straw",
        ),
        launchdarkly.FeatureFlagVariationArgs(
            value="bricks",
            name="Bricks",
            description="The strongest variation",
        ),
    ],
    defaults=launchdarkly.FeatureFlagDefaultsArgs(
        on_variation=2,
        off_variation=0,
    ),
    tags=[
        "example",
        "terraform",
        "multivariate",
        "building-materials",
    ])
import * as pulumi from "@pulumi/pulumi";
import * as launchdarkly from "@lbrlabs/pulumi-launchdarkly";

const buildingMaterials = new launchdarkly.FeatureFlag("buildingMaterials", {
    projectKey: launchdarkly_project.example.key,
    key: "building-materials",
    description: "this is a multivariate flag with string variations.",
    variationType: "string",
    variations: [
        {
            value: "straw",
            name: "Straw",
            description: "Watch out for wind.",
        },
        {
            value: "sticks",
            name: "Sticks",
            description: "Sturdier than straw",
        },
        {
            value: "bricks",
            name: "Bricks",
            description: "The strongest variation",
        },
    ],
    defaults: {
        onVariation: 2,
        offVariation: 0,
    },
    tags: [
        "example",
        "terraform",
        "multivariate",
        "building-materials",
    ],
});
resources:
  buildingMaterials:
    type: launchdarkly:FeatureFlag
    properties:
      projectKey: ${launchdarkly_project.example.key}
      key: building-materials
      description: this is a multivariate flag with string variations.
      variationType: string
      variations:
        - value: straw
          name: Straw
          description: Watch out for wind.
        - value: sticks
          name: Sticks
          description: Sturdier than straw
        - value: bricks
          name: Bricks
          description: The strongest variation
      defaults:
        onVariation: 2
        offVariation: 0
      tags:
        - example
        - terraform
        - multivariate
        - building-materials
using System.Collections.Generic;
using System.Text.Json;
using Pulumi;
using Launchdarkly = Lbrlabs.PulumiPackage.Launchdarkly;

return await Deployment.RunAsync(() => 
{
    var jsonExample = new Launchdarkly.FeatureFlag("jsonExample", new()
    {
        ProjectKey = "example-project",
        Key = "json-example",
        VariationType = "json",
        Variations = new[]
        {
            new Launchdarkly.Inputs.FeatureFlagVariationArgs
            {
                Name = "Single foo",
                Value = JsonSerializer.Serialize(new Dictionary<string, object?>
                {
                    ["foo"] = "bar",
                }),
            },
            new Launchdarkly.Inputs.FeatureFlagVariationArgs
            {
                Name = "Multiple foos",
                Value = JsonSerializer.Serialize(new Dictionary<string, object?>
                {
                    ["foos"] = new[]
                    {
                        "bar1",
                        "bar2",
                    },
                }),
            },
        },
        Defaults = new Launchdarkly.Inputs.FeatureFlagDefaultsArgs
        {
            OnVariation = 1,
            OffVariation = 0,
        },
    });

});
package main

import (
	"encoding/json"

	"github.com/lbrlabs/pulumi-launchdarkly/sdk/go/launchdarkly"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		tmpJSON0, err := json.Marshal(map[string]interface{}{
			"foo": "bar",
		})
		if err != nil {
			return err
		}
		json0 := string(tmpJSON0)
		tmpJSON1, err := json.Marshal(map[string]interface{}{
			"foos": []string{
				"bar1",
				"bar2",
			},
		})
		if err != nil {
			return err
		}
		json1 := string(tmpJSON1)
		_, err = launchdarkly.NewFeatureFlag(ctx, "jsonExample", &launchdarkly.FeatureFlagArgs{
			ProjectKey:    pulumi.String("example-project"),
			Key:           pulumi.String("json-example"),
			VariationType: pulumi.String("json"),
			Variations: launchdarkly.FeatureFlagVariationArray{
				&launchdarkly.FeatureFlagVariationArgs{
					Name:  pulumi.String("Single foo"),
					Value: pulumi.String(json0),
				},
				&launchdarkly.FeatureFlagVariationArgs{
					Name:  pulumi.String("Multiple foos"),
					Value: pulumi.String(json1),
				},
			},
			Defaults: &launchdarkly.FeatureFlagDefaultsArgs{
				OnVariation:  pulumi.Int(1),
				OffVariation: pulumi.Int(0),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.launchdarkly.FeatureFlag;
import com.pulumi.launchdarkly.FeatureFlagArgs;
import com.pulumi.launchdarkly.inputs.FeatureFlagVariationArgs;
import com.pulumi.launchdarkly.inputs.FeatureFlagDefaultsArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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 jsonExample = new FeatureFlag("jsonExample", FeatureFlagArgs.builder()        
            .projectKey("example-project")
            .key("json-example")
            .variationType("json")
            .variations(            
                FeatureFlagVariationArgs.builder()
                    .name("Single foo")
                    .value(serializeJson(
                        jsonObject(
                            jsonProperty("foo", "bar")
                        )))
                    .build(),
                FeatureFlagVariationArgs.builder()
                    .name("Multiple foos")
                    .value(serializeJson(
                        jsonObject(
                            jsonProperty("foos", jsonArray(
                                "bar1", 
                                "bar2"
                            ))
                        )))
                    .build())
            .defaults(FeatureFlagDefaultsArgs.builder()
                .onVariation(1)
                .offVariation(0)
                .build())
            .build());

    }
}
import pulumi
import json
import lbrlabs_pulumi_launchdarkly as launchdarkly

json_example = launchdarkly.FeatureFlag("jsonExample",
    project_key="example-project",
    key="json-example",
    variation_type="json",
    variations=[
        launchdarkly.FeatureFlagVariationArgs(
            name="Single foo",
            value=json.dumps({
                "foo": "bar",
            }),
        ),
        launchdarkly.FeatureFlagVariationArgs(
            name="Multiple foos",
            value=json.dumps({
                "foos": [
                    "bar1",
                    "bar2",
                ],
            }),
        ),
    ],
    defaults=launchdarkly.FeatureFlagDefaultsArgs(
        on_variation=1,
        off_variation=0,
    ))
import * as pulumi from "@pulumi/pulumi";
import * as launchdarkly from "@lbrlabs/pulumi-launchdarkly";

const jsonExample = new launchdarkly.FeatureFlag("jsonExample", {
    projectKey: "example-project",
    key: "json-example",
    variationType: "json",
    variations: [
        {
            name: "Single foo",
            value: JSON.stringify({
                foo: "bar",
            }),
        },
        {
            name: "Multiple foos",
            value: JSON.stringify({
                foos: [
                    "bar1",
                    "bar2",
                ],
            }),
        },
    ],
    defaults: {
        onVariation: 1,
        offVariation: 0,
    },
});
resources:
  jsonExample:
    type: launchdarkly:FeatureFlag
    properties:
      projectKey: example-project
      key: json-example
      variationType: json
      variations:
        - name: Single foo
          value:
            fn::toJSON:
              foo: bar
        - name: Multiple foos
          value:
            fn::toJSON:
              foos:
                - bar1
                - bar2
      defaults:
        onVariation: 1
        offVariation: 0

Create FeatureFlag Resource

new FeatureFlag(name: string, args: FeatureFlagArgs, opts?: CustomResourceOptions);
@overload
def FeatureFlag(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                archived: Optional[bool] = None,
                client_side_availabilities: Optional[Sequence[FeatureFlagClientSideAvailabilityArgs]] = None,
                custom_properties: Optional[Sequence[FeatureFlagCustomPropertyArgs]] = None,
                defaults: Optional[FeatureFlagDefaultsArgs] = None,
                description: Optional[str] = None,
                include_in_snippet: Optional[bool] = None,
                key: Optional[str] = None,
                maintainer_id: Optional[str] = None,
                name: Optional[str] = None,
                project_key: Optional[str] = None,
                tags: Optional[Sequence[str]] = None,
                temporary: Optional[bool] = None,
                variation_type: Optional[str] = None,
                variations: Optional[Sequence[FeatureFlagVariationArgs]] = None)
@overload
def FeatureFlag(resource_name: str,
                args: FeatureFlagArgs,
                opts: Optional[ResourceOptions] = None)
func NewFeatureFlag(ctx *Context, name string, args FeatureFlagArgs, opts ...ResourceOption) (*FeatureFlag, error)
public FeatureFlag(string name, FeatureFlagArgs args, CustomResourceOptions? opts = null)
public FeatureFlag(String name, FeatureFlagArgs args)
public FeatureFlag(String name, FeatureFlagArgs args, CustomResourceOptions options)
type: launchdarkly:FeatureFlag
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args FeatureFlagArgs
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 FeatureFlagArgs
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 FeatureFlagArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args FeatureFlagArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args FeatureFlagArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

FeatureFlag Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The FeatureFlag resource accepts the following input properties:

Key string

The unique feature flag key that references the flag in your application code. A change in this field will force the destruction of the existing resource and the creation of a new one.

ProjectKey string

The feature flag's project key. A change in this field will force the destruction of the existing resource and the creation of a new one.

VariationType string

The feature flag's variation type: boolean, string, number or json.

Archived bool

Whether to archive the flag

ClientSideAvailabilities List<Lbrlabs.PulumiPackage.Launchdarkly.Inputs.FeatureFlagClientSideAvailabilityArgs>

A block describing whether this flag should be made available to the client-side JavaScript SDK using the client-side Id, mobile key, or both. This value gets its default from your project configuration if not set. To learn more, read Nested Client-Side Availability Block.

CustomProperties List<Lbrlabs.PulumiPackage.Launchdarkly.Inputs.FeatureFlagCustomPropertyArgs>

List of nested blocks describing the feature flag's custom properties. To learn more, read Nested Custom Properties.

Defaults Lbrlabs.PulumiPackage.Launchdarkly.Inputs.FeatureFlagDefaultsArgs

A block containing the indices of the variations to be used as the default on and off variations in all new environments. Flag configurations in existing environments will not be changed nor updated if the configuration block is removed. To learn more, read Nested Defaults Blocks.

Description string

The feature flag's description.

IncludeInSnippet bool

Deprecated (Optional) Specifies whether this flag should be made available to the client-side JavaScript SDK using the client-side Id. This value gets its default from your project configuration if not set. include_in_snippet is now deprecated. Please migrate to client_side_availability.using_environment_id to maintain future compatability.

Deprecated:

'include_in_snippet' is now deprecated. Please migrate to 'client_side_availability' to maintain future compatability.

MaintainerId string

The LaunchDarkly id of the user who will maintain the flag. If not set, the API will automatically apply the member associated with your Terraform API key or the most recently set maintainer

Name string

The human-readable name of the feature flag.

Tags List<string>

Set of feature flag tags.

Temporary bool

Specifies whether the flag is a temporary flag.

Variations List<Lbrlabs.PulumiPackage.Launchdarkly.Inputs.FeatureFlagVariationArgs>

List of nested blocks describing the variations associated with the feature flag. You must specify at least two variations. To learn more, read Nested Variations Blocks.

Key string

The unique feature flag key that references the flag in your application code. A change in this field will force the destruction of the existing resource and the creation of a new one.

ProjectKey string

The feature flag's project key. A change in this field will force the destruction of the existing resource and the creation of a new one.

VariationType string

The feature flag's variation type: boolean, string, number or json.

Archived bool

Whether to archive the flag

ClientSideAvailabilities []FeatureFlagClientSideAvailabilityArgs

A block describing whether this flag should be made available to the client-side JavaScript SDK using the client-side Id, mobile key, or both. This value gets its default from your project configuration if not set. To learn more, read Nested Client-Side Availability Block.

CustomProperties []FeatureFlagCustomPropertyArgs

List of nested blocks describing the feature flag's custom properties. To learn more, read Nested Custom Properties.

Defaults FeatureFlagDefaultsArgs

A block containing the indices of the variations to be used as the default on and off variations in all new environments. Flag configurations in existing environments will not be changed nor updated if the configuration block is removed. To learn more, read Nested Defaults Blocks.

Description string

The feature flag's description.

IncludeInSnippet bool

Deprecated (Optional) Specifies whether this flag should be made available to the client-side JavaScript SDK using the client-side Id. This value gets its default from your project configuration if not set. include_in_snippet is now deprecated. Please migrate to client_side_availability.using_environment_id to maintain future compatability.

Deprecated:

'include_in_snippet' is now deprecated. Please migrate to 'client_side_availability' to maintain future compatability.

MaintainerId string

The LaunchDarkly id of the user who will maintain the flag. If not set, the API will automatically apply the member associated with your Terraform API key or the most recently set maintainer

Name string

The human-readable name of the feature flag.

Tags []string

Set of feature flag tags.

Temporary bool

Specifies whether the flag is a temporary flag.

Variations []FeatureFlagVariationArgs

List of nested blocks describing the variations associated with the feature flag. You must specify at least two variations. To learn more, read Nested Variations Blocks.

key String

The unique feature flag key that references the flag in your application code. A change in this field will force the destruction of the existing resource and the creation of a new one.

projectKey String

The feature flag's project key. A change in this field will force the destruction of the existing resource and the creation of a new one.

variationType String

The feature flag's variation type: boolean, string, number or json.

archived Boolean

Whether to archive the flag

clientSideAvailabilities List<FeatureFlagClientSideAvailabilityArgs>

A block describing whether this flag should be made available to the client-side JavaScript SDK using the client-side Id, mobile key, or both. This value gets its default from your project configuration if not set. To learn more, read Nested Client-Side Availability Block.

customProperties List<FeatureFlagCustomPropertyArgs>

List of nested blocks describing the feature flag's custom properties. To learn more, read Nested Custom Properties.

defaults FeatureFlagDefaultsArgs

A block containing the indices of the variations to be used as the default on and off variations in all new environments. Flag configurations in existing environments will not be changed nor updated if the configuration block is removed. To learn more, read Nested Defaults Blocks.

description String

The feature flag's description.

includeInSnippet Boolean

Deprecated (Optional) Specifies whether this flag should be made available to the client-side JavaScript SDK using the client-side Id. This value gets its default from your project configuration if not set. include_in_snippet is now deprecated. Please migrate to client_side_availability.using_environment_id to maintain future compatability.

Deprecated:

'include_in_snippet' is now deprecated. Please migrate to 'client_side_availability' to maintain future compatability.

maintainerId String

The LaunchDarkly id of the user who will maintain the flag. If not set, the API will automatically apply the member associated with your Terraform API key or the most recently set maintainer

name String

The human-readable name of the feature flag.

tags List<String>

Set of feature flag tags.

temporary Boolean

Specifies whether the flag is a temporary flag.

variations List<FeatureFlagVariationArgs>

List of nested blocks describing the variations associated with the feature flag. You must specify at least two variations. To learn more, read Nested Variations Blocks.

key string

The unique feature flag key that references the flag in your application code. A change in this field will force the destruction of the existing resource and the creation of a new one.

projectKey string

The feature flag's project key. A change in this field will force the destruction of the existing resource and the creation of a new one.

variationType string

The feature flag's variation type: boolean, string, number or json.

archived boolean

Whether to archive the flag

clientSideAvailabilities FeatureFlagClientSideAvailabilityArgs[]

A block describing whether this flag should be made available to the client-side JavaScript SDK using the client-side Id, mobile key, or both. This value gets its default from your project configuration if not set. To learn more, read Nested Client-Side Availability Block.

customProperties FeatureFlagCustomPropertyArgs[]

List of nested blocks describing the feature flag's custom properties. To learn more, read Nested Custom Properties.

defaults FeatureFlagDefaultsArgs

A block containing the indices of the variations to be used as the default on and off variations in all new environments. Flag configurations in existing environments will not be changed nor updated if the configuration block is removed. To learn more, read Nested Defaults Blocks.

description string

The feature flag's description.

includeInSnippet boolean

Deprecated (Optional) Specifies whether this flag should be made available to the client-side JavaScript SDK using the client-side Id. This value gets its default from your project configuration if not set. include_in_snippet is now deprecated. Please migrate to client_side_availability.using_environment_id to maintain future compatability.

Deprecated:

'include_in_snippet' is now deprecated. Please migrate to 'client_side_availability' to maintain future compatability.

maintainerId string

The LaunchDarkly id of the user who will maintain the flag. If not set, the API will automatically apply the member associated with your Terraform API key or the most recently set maintainer

name string

The human-readable name of the feature flag.

tags string[]

Set of feature flag tags.

temporary boolean

Specifies whether the flag is a temporary flag.

variations FeatureFlagVariationArgs[]

List of nested blocks describing the variations associated with the feature flag. You must specify at least two variations. To learn more, read Nested Variations Blocks.

key str

The unique feature flag key that references the flag in your application code. A change in this field will force the destruction of the existing resource and the creation of a new one.

project_key str

The feature flag's project key. A change in this field will force the destruction of the existing resource and the creation of a new one.

variation_type str

The feature flag's variation type: boolean, string, number or json.

archived bool

Whether to archive the flag

client_side_availabilities Sequence[FeatureFlagClientSideAvailabilityArgs]

A block describing whether this flag should be made available to the client-side JavaScript SDK using the client-side Id, mobile key, or both. This value gets its default from your project configuration if not set. To learn more, read Nested Client-Side Availability Block.

custom_properties Sequence[FeatureFlagCustomPropertyArgs]

List of nested blocks describing the feature flag's custom properties. To learn more, read Nested Custom Properties.

defaults FeatureFlagDefaultsArgs

A block containing the indices of the variations to be used as the default on and off variations in all new environments. Flag configurations in existing environments will not be changed nor updated if the configuration block is removed. To learn more, read Nested Defaults Blocks.

description str

The feature flag's description.

include_in_snippet bool

Deprecated (Optional) Specifies whether this flag should be made available to the client-side JavaScript SDK using the client-side Id. This value gets its default from your project configuration if not set. include_in_snippet is now deprecated. Please migrate to client_side_availability.using_environment_id to maintain future compatability.

Deprecated:

'include_in_snippet' is now deprecated. Please migrate to 'client_side_availability' to maintain future compatability.

maintainer_id str

The LaunchDarkly id of the user who will maintain the flag. If not set, the API will automatically apply the member associated with your Terraform API key or the most recently set maintainer

name str

The human-readable name of the feature flag.

tags Sequence[str]

Set of feature flag tags.

temporary bool

Specifies whether the flag is a temporary flag.

variations Sequence[FeatureFlagVariationArgs]

List of nested blocks describing the variations associated with the feature flag. You must specify at least two variations. To learn more, read Nested Variations Blocks.

key String

The unique feature flag key that references the flag in your application code. A change in this field will force the destruction of the existing resource and the creation of a new one.

projectKey String

The feature flag's project key. A change in this field will force the destruction of the existing resource and the creation of a new one.

variationType String

The feature flag's variation type: boolean, string, number or json.

archived Boolean

Whether to archive the flag

clientSideAvailabilities List<Property Map>

A block describing whether this flag should be made available to the client-side JavaScript SDK using the client-side Id, mobile key, or both. This value gets its default from your project configuration if not set. To learn more, read Nested Client-Side Availability Block.

customProperties List<Property Map>

List of nested blocks describing the feature flag's custom properties. To learn more, read Nested Custom Properties.

defaults Property Map

A block containing the indices of the variations to be used as the default on and off variations in all new environments. Flag configurations in existing environments will not be changed nor updated if the configuration block is removed. To learn more, read Nested Defaults Blocks.

description String

The feature flag's description.

includeInSnippet Boolean

Deprecated (Optional) Specifies whether this flag should be made available to the client-side JavaScript SDK using the client-side Id. This value gets its default from your project configuration if not set. include_in_snippet is now deprecated. Please migrate to client_side_availability.using_environment_id to maintain future compatability.

Deprecated:

'include_in_snippet' is now deprecated. Please migrate to 'client_side_availability' to maintain future compatability.

maintainerId String

The LaunchDarkly id of the user who will maintain the flag. If not set, the API will automatically apply the member associated with your Terraform API key or the most recently set maintainer

name String

The human-readable name of the feature flag.

tags List<String>

Set of feature flag tags.

temporary Boolean

Specifies whether the flag is a temporary flag.

variations List<Property Map>

List of nested blocks describing the variations associated with the feature flag. You must specify at least two variations. To learn more, read Nested Variations Blocks.

Outputs

All input properties are implicitly available as output properties. Additionally, the FeatureFlag 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 str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing FeatureFlag Resource

Get an existing FeatureFlag 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?: FeatureFlagState, opts?: CustomResourceOptions): FeatureFlag
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        archived: Optional[bool] = None,
        client_side_availabilities: Optional[Sequence[FeatureFlagClientSideAvailabilityArgs]] = None,
        custom_properties: Optional[Sequence[FeatureFlagCustomPropertyArgs]] = None,
        defaults: Optional[FeatureFlagDefaultsArgs] = None,
        description: Optional[str] = None,
        include_in_snippet: Optional[bool] = None,
        key: Optional[str] = None,
        maintainer_id: Optional[str] = None,
        name: Optional[str] = None,
        project_key: Optional[str] = None,
        tags: Optional[Sequence[str]] = None,
        temporary: Optional[bool] = None,
        variation_type: Optional[str] = None,
        variations: Optional[Sequence[FeatureFlagVariationArgs]] = None) -> FeatureFlag
func GetFeatureFlag(ctx *Context, name string, id IDInput, state *FeatureFlagState, opts ...ResourceOption) (*FeatureFlag, error)
public static FeatureFlag Get(string name, Input<string> id, FeatureFlagState? state, CustomResourceOptions? opts = null)
public static FeatureFlag get(String name, Output<String> id, FeatureFlagState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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:
Archived bool

Whether to archive the flag

ClientSideAvailabilities List<Lbrlabs.PulumiPackage.Launchdarkly.Inputs.FeatureFlagClientSideAvailabilityArgs>

A block describing whether this flag should be made available to the client-side JavaScript SDK using the client-side Id, mobile key, or both. This value gets its default from your project configuration if not set. To learn more, read Nested Client-Side Availability Block.

CustomProperties List<Lbrlabs.PulumiPackage.Launchdarkly.Inputs.FeatureFlagCustomPropertyArgs>

List of nested blocks describing the feature flag's custom properties. To learn more, read Nested Custom Properties.

Defaults Lbrlabs.PulumiPackage.Launchdarkly.Inputs.FeatureFlagDefaultsArgs

A block containing the indices of the variations to be used as the default on and off variations in all new environments. Flag configurations in existing environments will not be changed nor updated if the configuration block is removed. To learn more, read Nested Defaults Blocks.

Description string

The feature flag's description.

IncludeInSnippet bool

Deprecated (Optional) Specifies whether this flag should be made available to the client-side JavaScript SDK using the client-side Id. This value gets its default from your project configuration if not set. include_in_snippet is now deprecated. Please migrate to client_side_availability.using_environment_id to maintain future compatability.

Deprecated:

'include_in_snippet' is now deprecated. Please migrate to 'client_side_availability' to maintain future compatability.

Key string

The unique feature flag key that references the flag in your application code. A change in this field will force the destruction of the existing resource and the creation of a new one.

MaintainerId string

The LaunchDarkly id of the user who will maintain the flag. If not set, the API will automatically apply the member associated with your Terraform API key or the most recently set maintainer

Name string

The human-readable name of the feature flag.

ProjectKey string

The feature flag's project key. A change in this field will force the destruction of the existing resource and the creation of a new one.

Tags List<string>

Set of feature flag tags.

Temporary bool

Specifies whether the flag is a temporary flag.

VariationType string

The feature flag's variation type: boolean, string, number or json.

Variations List<Lbrlabs.PulumiPackage.Launchdarkly.Inputs.FeatureFlagVariationArgs>

List of nested blocks describing the variations associated with the feature flag. You must specify at least two variations. To learn more, read Nested Variations Blocks.

Archived bool

Whether to archive the flag

ClientSideAvailabilities []FeatureFlagClientSideAvailabilityArgs

A block describing whether this flag should be made available to the client-side JavaScript SDK using the client-side Id, mobile key, or both. This value gets its default from your project configuration if not set. To learn more, read Nested Client-Side Availability Block.

CustomProperties []FeatureFlagCustomPropertyArgs

List of nested blocks describing the feature flag's custom properties. To learn more, read Nested Custom Properties.

Defaults FeatureFlagDefaultsArgs

A block containing the indices of the variations to be used as the default on and off variations in all new environments. Flag configurations in existing environments will not be changed nor updated if the configuration block is removed. To learn more, read Nested Defaults Blocks.

Description string

The feature flag's description.

IncludeInSnippet bool

Deprecated (Optional) Specifies whether this flag should be made available to the client-side JavaScript SDK using the client-side Id. This value gets its default from your project configuration if not set. include_in_snippet is now deprecated. Please migrate to client_side_availability.using_environment_id to maintain future compatability.

Deprecated:

'include_in_snippet' is now deprecated. Please migrate to 'client_side_availability' to maintain future compatability.

Key string

The unique feature flag key that references the flag in your application code. A change in this field will force the destruction of the existing resource and the creation of a new one.

MaintainerId string

The LaunchDarkly id of the user who will maintain the flag. If not set, the API will automatically apply the member associated with your Terraform API key or the most recently set maintainer

Name string

The human-readable name of the feature flag.

ProjectKey string

The feature flag's project key. A change in this field will force the destruction of the existing resource and the creation of a new one.

Tags []string

Set of feature flag tags.

Temporary bool

Specifies whether the flag is a temporary flag.

VariationType string

The feature flag's variation type: boolean, string, number or json.

Variations []FeatureFlagVariationArgs

List of nested blocks describing the variations associated with the feature flag. You must specify at least two variations. To learn more, read Nested Variations Blocks.

archived Boolean

Whether to archive the flag

clientSideAvailabilities List<FeatureFlagClientSideAvailabilityArgs>

A block describing whether this flag should be made available to the client-side JavaScript SDK using the client-side Id, mobile key, or both. This value gets its default from your project configuration if not set. To learn more, read Nested Client-Side Availability Block.

customProperties List<FeatureFlagCustomPropertyArgs>

List of nested blocks describing the feature flag's custom properties. To learn more, read Nested Custom Properties.

defaults FeatureFlagDefaultsArgs

A block containing the indices of the variations to be used as the default on and off variations in all new environments. Flag configurations in existing environments will not be changed nor updated if the configuration block is removed. To learn more, read Nested Defaults Blocks.

description String

The feature flag's description.

includeInSnippet Boolean

Deprecated (Optional) Specifies whether this flag should be made available to the client-side JavaScript SDK using the client-side Id. This value gets its default from your project configuration if not set. include_in_snippet is now deprecated. Please migrate to client_side_availability.using_environment_id to maintain future compatability.

Deprecated:

'include_in_snippet' is now deprecated. Please migrate to 'client_side_availability' to maintain future compatability.

key String

The unique feature flag key that references the flag in your application code. A change in this field will force the destruction of the existing resource and the creation of a new one.

maintainerId String

The LaunchDarkly id of the user who will maintain the flag. If not set, the API will automatically apply the member associated with your Terraform API key or the most recently set maintainer

name String

The human-readable name of the feature flag.

projectKey String

The feature flag's project key. A change in this field will force the destruction of the existing resource and the creation of a new one.

tags List<String>

Set of feature flag tags.

temporary Boolean

Specifies whether the flag is a temporary flag.

variationType String

The feature flag's variation type: boolean, string, number or json.

variations List<FeatureFlagVariationArgs>

List of nested blocks describing the variations associated with the feature flag. You must specify at least two variations. To learn more, read Nested Variations Blocks.

archived boolean

Whether to archive the flag

clientSideAvailabilities FeatureFlagClientSideAvailabilityArgs[]

A block describing whether this flag should be made available to the client-side JavaScript SDK using the client-side Id, mobile key, or both. This value gets its default from your project configuration if not set. To learn more, read Nested Client-Side Availability Block.

customProperties FeatureFlagCustomPropertyArgs[]

List of nested blocks describing the feature flag's custom properties. To learn more, read Nested Custom Properties.

defaults FeatureFlagDefaultsArgs

A block containing the indices of the variations to be used as the default on and off variations in all new environments. Flag configurations in existing environments will not be changed nor updated if the configuration block is removed. To learn more, read Nested Defaults Blocks.

description string

The feature flag's description.

includeInSnippet boolean

Deprecated (Optional) Specifies whether this flag should be made available to the client-side JavaScript SDK using the client-side Id. This value gets its default from your project configuration if not set. include_in_snippet is now deprecated. Please migrate to client_side_availability.using_environment_id to maintain future compatability.

Deprecated:

'include_in_snippet' is now deprecated. Please migrate to 'client_side_availability' to maintain future compatability.

key string

The unique feature flag key that references the flag in your application code. A change in this field will force the destruction of the existing resource and the creation of a new one.

maintainerId string

The LaunchDarkly id of the user who will maintain the flag. If not set, the API will automatically apply the member associated with your Terraform API key or the most recently set maintainer

name string

The human-readable name of the feature flag.

projectKey string

The feature flag's project key. A change in this field will force the destruction of the existing resource and the creation of a new one.

tags string[]

Set of feature flag tags.

temporary boolean

Specifies whether the flag is a temporary flag.

variationType string

The feature flag's variation type: boolean, string, number or json.

variations FeatureFlagVariationArgs[]

List of nested blocks describing the variations associated with the feature flag. You must specify at least two variations. To learn more, read Nested Variations Blocks.

archived bool

Whether to archive the flag

client_side_availabilities Sequence[FeatureFlagClientSideAvailabilityArgs]

A block describing whether this flag should be made available to the client-side JavaScript SDK using the client-side Id, mobile key, or both. This value gets its default from your project configuration if not set. To learn more, read Nested Client-Side Availability Block.

custom_properties Sequence[FeatureFlagCustomPropertyArgs]

List of nested blocks describing the feature flag's custom properties. To learn more, read Nested Custom Properties.

defaults FeatureFlagDefaultsArgs

A block containing the indices of the variations to be used as the default on and off variations in all new environments. Flag configurations in existing environments will not be changed nor updated if the configuration block is removed. To learn more, read Nested Defaults Blocks.

description str

The feature flag's description.

include_in_snippet bool

Deprecated (Optional) Specifies whether this flag should be made available to the client-side JavaScript SDK using the client-side Id. This value gets its default from your project configuration if not set. include_in_snippet is now deprecated. Please migrate to client_side_availability.using_environment_id to maintain future compatability.

Deprecated:

'include_in_snippet' is now deprecated. Please migrate to 'client_side_availability' to maintain future compatability.

key str

The unique feature flag key that references the flag in your application code. A change in this field will force the destruction of the existing resource and the creation of a new one.

maintainer_id str

The LaunchDarkly id of the user who will maintain the flag. If not set, the API will automatically apply the member associated with your Terraform API key or the most recently set maintainer

name str

The human-readable name of the feature flag.

project_key str

The feature flag's project key. A change in this field will force the destruction of the existing resource and the creation of a new one.

tags Sequence[str]

Set of feature flag tags.

temporary bool

Specifies whether the flag is a temporary flag.

variation_type str

The feature flag's variation type: boolean, string, number or json.

variations Sequence[FeatureFlagVariationArgs]

List of nested blocks describing the variations associated with the feature flag. You must specify at least two variations. To learn more, read Nested Variations Blocks.

archived Boolean

Whether to archive the flag

clientSideAvailabilities List<Property Map>

A block describing whether this flag should be made available to the client-side JavaScript SDK using the client-side Id, mobile key, or both. This value gets its default from your project configuration if not set. To learn more, read Nested Client-Side Availability Block.

customProperties List<Property Map>

List of nested blocks describing the feature flag's custom properties. To learn more, read Nested Custom Properties.

defaults Property Map

A block containing the indices of the variations to be used as the default on and off variations in all new environments. Flag configurations in existing environments will not be changed nor updated if the configuration block is removed. To learn more, read Nested Defaults Blocks.

description String

The feature flag's description.

includeInSnippet Boolean

Deprecated (Optional) Specifies whether this flag should be made available to the client-side JavaScript SDK using the client-side Id. This value gets its default from your project configuration if not set. include_in_snippet is now deprecated. Please migrate to client_side_availability.using_environment_id to maintain future compatability.

Deprecated:

'include_in_snippet' is now deprecated. Please migrate to 'client_side_availability' to maintain future compatability.

key String

The unique feature flag key that references the flag in your application code. A change in this field will force the destruction of the existing resource and the creation of a new one.

maintainerId String

The LaunchDarkly id of the user who will maintain the flag. If not set, the API will automatically apply the member associated with your Terraform API key or the most recently set maintainer

name String

The human-readable name of the feature flag.

projectKey String

The feature flag's project key. A change in this field will force the destruction of the existing resource and the creation of a new one.

tags List<String>

Set of feature flag tags.

temporary Boolean

Specifies whether the flag is a temporary flag.

variationType String

The feature flag's variation type: boolean, string, number or json.

variations List<Property Map>

List of nested blocks describing the variations associated with the feature flag. You must specify at least two variations. To learn more, read Nested Variations Blocks.

Supporting Types

FeatureFlagClientSideAvailability

UsingEnvironmentId bool

Whether this flag is available to SDKs using the client-side ID.

UsingMobileKey bool

Whether this flag is available to SDKs using a mobile key.

UsingEnvironmentId bool

Whether this flag is available to SDKs using the client-side ID.

UsingMobileKey bool

Whether this flag is available to SDKs using a mobile key.

usingEnvironmentId Boolean

Whether this flag is available to SDKs using the client-side ID.

usingMobileKey Boolean

Whether this flag is available to SDKs using a mobile key.

usingEnvironmentId boolean

Whether this flag is available to SDKs using the client-side ID.

usingMobileKey boolean

Whether this flag is available to SDKs using a mobile key.

using_environment_id bool

Whether this flag is available to SDKs using the client-side ID.

using_mobile_key bool

Whether this flag is available to SDKs using a mobile key.

usingEnvironmentId Boolean

Whether this flag is available to SDKs using the client-side ID.

usingMobileKey Boolean

Whether this flag is available to SDKs using a mobile key.

FeatureFlagCustomProperty

Key string

The unique custom property key.

Name string

The name of the custom property.

Values List<string>

The list of custom property value strings.

Key string

The unique custom property key.

Name string

The name of the custom property.

Values []string

The list of custom property value strings.

key String

The unique custom property key.

name String

The name of the custom property.

values List<String>

The list of custom property value strings.

key string

The unique custom property key.

name string

The name of the custom property.

values string[]

The list of custom property value strings.

key str

The unique custom property key.

name str

The name of the custom property.

values Sequence[str]

The list of custom property value strings.

key String

The unique custom property key.

name String

The name of the custom property.

values List<String>

The list of custom property value strings.

FeatureFlagDefaults

OffVariation int

The index of the variation the flag will default to in all new environments when off.

OnVariation int

The index of the variation the flag will default to in all new environments when on.

OffVariation int

The index of the variation the flag will default to in all new environments when off.

OnVariation int

The index of the variation the flag will default to in all new environments when on.

offVariation Integer

The index of the variation the flag will default to in all new environments when off.

onVariation Integer

The index of the variation the flag will default to in all new environments when on.

offVariation number

The index of the variation the flag will default to in all new environments when off.

onVariation number

The index of the variation the flag will default to in all new environments when on.

off_variation int

The index of the variation the flag will default to in all new environments when off.

on_variation int

The index of the variation the flag will default to in all new environments when on.

offVariation Number

The index of the variation the flag will default to in all new environments when off.

onVariation Number

The index of the variation the flag will default to in all new environments when on.

FeatureFlagVariation

Value string

The variation value. The value's type must correspond to the variation_type argument. For example: variation_type = "boolean" accepts only true or false. The "number" variation type accepts both floats and ints, but please note that any trailing zeroes on floats will be trimmed (i.e. 1.1 and 1.100 will both be converted to 1.1).

Description string

The variation's description.

Name string

The name of the variation.

Value string

The variation value. The value's type must correspond to the variation_type argument. For example: variation_type = "boolean" accepts only true or false. The "number" variation type accepts both floats and ints, but please note that any trailing zeroes on floats will be trimmed (i.e. 1.1 and 1.100 will both be converted to 1.1).

Description string

The variation's description.

Name string

The name of the variation.

value String

The variation value. The value's type must correspond to the variation_type argument. For example: variation_type = "boolean" accepts only true or false. The "number" variation type accepts both floats and ints, but please note that any trailing zeroes on floats will be trimmed (i.e. 1.1 and 1.100 will both be converted to 1.1).

description String

The variation's description.

name String

The name of the variation.

value string

The variation value. The value's type must correspond to the variation_type argument. For example: variation_type = "boolean" accepts only true or false. The "number" variation type accepts both floats and ints, but please note that any trailing zeroes on floats will be trimmed (i.e. 1.1 and 1.100 will both be converted to 1.1).

description string

The variation's description.

name string

The name of the variation.

value str

The variation value. The value's type must correspond to the variation_type argument. For example: variation_type = "boolean" accepts only true or false. The "number" variation type accepts both floats and ints, but please note that any trailing zeroes on floats will be trimmed (i.e. 1.1 and 1.100 will both be converted to 1.1).

description str

The variation's description.

name str

The name of the variation.

value String

The variation value. The value's type must correspond to the variation_type argument. For example: variation_type = "boolean" accepts only true or false. The "number" variation type accepts both floats and ints, but please note that any trailing zeroes on floats will be trimmed (i.e. 1.1 and 1.100 will both be converted to 1.1).

description String

The variation's description.

name String

The name of the variation.

Import

You can import a feature flag using the feature flag’s ID in the format project_key/flag_key. For example

 $ pulumi import launchdarkly:index/featureFlag:FeatureFlag building_materials example-project/building-materials

Package Details

Repository
launchdarkly lbrlabs/pulumi-launchdarkly
License
Notes

This Pulumi package is based on the launchdarkly Terraform Provider.