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
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new FeatureFlag(name: string, args: FeatureFlagArgs, opts?: CustomResourceOptions);
@overload
def FeatureFlag(resource_name: str,
args: FeatureFlagArgs,
opts: Optional[ResourceOptions] = None)
@overload
def FeatureFlag(resource_name: str,
opts: Optional[ResourceOptions] = None,
project_key: Optional[str] = None,
key: Optional[str] = None,
variation_type: Optional[str] = None,
description: Optional[str] = None,
maintainer_id: Optional[str] = None,
include_in_snippet: Optional[bool] = None,
client_side_availabilities: Optional[Sequence[FeatureFlagClientSideAvailabilityArgs]] = None,
defaults: Optional[FeatureFlagDefaultsArgs] = None,
tags: Optional[Sequence[str]] = None,
archived: Optional[bool] = None,
name: Optional[str] = None,
temporary: Optional[bool] = None,
custom_properties: Optional[Sequence[FeatureFlagCustomPropertyArgs]] = None,
variations: Optional[Sequence[FeatureFlagVariationArgs]] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var featureFlagResource = new Launchdarkly.FeatureFlag("featureFlagResource", new()
{
ProjectKey = "string",
Key = "string",
VariationType = "string",
Description = "string",
MaintainerId = "string",
ClientSideAvailabilities = new[]
{
new Launchdarkly.Inputs.FeatureFlagClientSideAvailabilityArgs
{
UsingEnvironmentId = false,
UsingMobileKey = false,
},
},
Defaults = new Launchdarkly.Inputs.FeatureFlagDefaultsArgs
{
OffVariation = 0,
OnVariation = 0,
},
Tags = new[]
{
"string",
},
Archived = false,
Name = "string",
Temporary = false,
CustomProperties = new[]
{
new Launchdarkly.Inputs.FeatureFlagCustomPropertyArgs
{
Key = "string",
Name = "string",
Values = new[]
{
"string",
},
},
},
Variations = new[]
{
new Launchdarkly.Inputs.FeatureFlagVariationArgs
{
Value = "string",
Description = "string",
Name = "string",
},
},
});
example, err := launchdarkly.NewFeatureFlag(ctx, "featureFlagResource", &launchdarkly.FeatureFlagArgs{
ProjectKey: pulumi.String("string"),
Key: pulumi.String("string"),
VariationType: pulumi.String("string"),
Description: pulumi.String("string"),
MaintainerId: pulumi.String("string"),
ClientSideAvailabilities: launchdarkly.FeatureFlagClientSideAvailabilityArray{
&launchdarkly.FeatureFlagClientSideAvailabilityArgs{
UsingEnvironmentId: pulumi.Bool(false),
UsingMobileKey: pulumi.Bool(false),
},
},
Defaults: &launchdarkly.FeatureFlagDefaultsArgs{
OffVariation: pulumi.Int(0),
OnVariation: pulumi.Int(0),
},
Tags: pulumi.StringArray{
pulumi.String("string"),
},
Archived: pulumi.Bool(false),
Name: pulumi.String("string"),
Temporary: pulumi.Bool(false),
CustomProperties: launchdarkly.FeatureFlagCustomPropertyArray{
&launchdarkly.FeatureFlagCustomPropertyArgs{
Key: pulumi.String("string"),
Name: pulumi.String("string"),
Values: pulumi.StringArray{
pulumi.String("string"),
},
},
},
Variations: launchdarkly.FeatureFlagVariationArray{
&launchdarkly.FeatureFlagVariationArgs{
Value: pulumi.String("string"),
Description: pulumi.String("string"),
Name: pulumi.String("string"),
},
},
})
var featureFlagResource = new FeatureFlag("featureFlagResource", FeatureFlagArgs.builder()
.projectKey("string")
.key("string")
.variationType("string")
.description("string")
.maintainerId("string")
.clientSideAvailabilities(FeatureFlagClientSideAvailabilityArgs.builder()
.usingEnvironmentId(false)
.usingMobileKey(false)
.build())
.defaults(FeatureFlagDefaultsArgs.builder()
.offVariation(0)
.onVariation(0)
.build())
.tags("string")
.archived(false)
.name("string")
.temporary(false)
.customProperties(FeatureFlagCustomPropertyArgs.builder()
.key("string")
.name("string")
.values("string")
.build())
.variations(FeatureFlagVariationArgs.builder()
.value("string")
.description("string")
.name("string")
.build())
.build());
feature_flag_resource = launchdarkly.FeatureFlag("featureFlagResource",
project_key="string",
key="string",
variation_type="string",
description="string",
maintainer_id="string",
client_side_availabilities=[{
"using_environment_id": False,
"using_mobile_key": False,
}],
defaults={
"off_variation": 0,
"on_variation": 0,
},
tags=["string"],
archived=False,
name="string",
temporary=False,
custom_properties=[{
"key": "string",
"name": "string",
"values": ["string"],
}],
variations=[{
"value": "string",
"description": "string",
"name": "string",
}])
const featureFlagResource = new launchdarkly.FeatureFlag("featureFlagResource", {
projectKey: "string",
key: "string",
variationType: "string",
description: "string",
maintainerId: "string",
clientSideAvailabilities: [{
usingEnvironmentId: false,
usingMobileKey: false,
}],
defaults: {
offVariation: 0,
onVariation: 0,
},
tags: ["string"],
archived: false,
name: "string",
temporary: false,
customProperties: [{
key: "string",
name: "string",
values: ["string"],
}],
variations: [{
value: "string",
description: "string",
name: "string",
}],
});
type: launchdarkly:FeatureFlag
properties:
archived: false
clientSideAvailabilities:
- usingEnvironmentId: false
usingMobileKey: false
customProperties:
- key: string
name: string
values:
- string
defaults:
offVariation: 0
onVariation: 0
description: string
key: string
maintainerId: string
name: string
projectKey: string
tags:
- string
temporary: false
variationType: string
variations:
- description: string
name: string
value: string
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
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.
- Project
Key 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.
- Variation
Type string - The feature flag's variation type:
boolean
,string
,number
orjson
. - Archived bool
- Whether to archive the flag
- Client
Side List<Lbrlabs.Availabilities Pulumi Package. Launchdarkly. Inputs. Feature Flag Client Side Availability> - 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 List<Lbrlabs.Pulumi Package. Launchdarkly. Inputs. Feature Flag Custom Property> - List of nested blocks describing the feature flag's custom properties. To learn more, read Nested Custom Properties.
- Defaults
Lbrlabs.
Pulumi Package. Launchdarkly. Inputs. Feature Flag Defaults - 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.
- Include
In boolSnippet - 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 toclient_side_availability.using_environment_id
to maintain future compatability. - Maintainer
Id 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.
- List<string>
- Set of feature flag tags.
- Temporary bool
- Specifies whether the flag is a temporary flag.
- Variations
List<Lbrlabs.
Pulumi Package. Launchdarkly. Inputs. Feature Flag Variation> - 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.
- Project
Key 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.
- Variation
Type string - The feature flag's variation type:
boolean
,string
,number
orjson
. - Archived bool
- Whether to archive the flag
- Client
Side []FeatureAvailabilities Flag Client Side Availability Args - 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 []FeatureFlag Custom Property Args - List of nested blocks describing the feature flag's custom properties. To learn more, read Nested Custom Properties.
- Defaults
Feature
Flag Defaults Args - 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.
- Include
In boolSnippet - 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 toclient_side_availability.using_environment_id
to maintain future compatability. - Maintainer
Id 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.
- []string
- Set of feature flag tags.
- Temporary bool
- Specifies whether the flag is a temporary flag.
- Variations
[]Feature
Flag Variation Args - 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.
- project
Key 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.
- variation
Type String - The feature flag's variation type:
boolean
,string
,number
orjson
. - archived Boolean
- Whether to archive the flag
- client
Side List<FeatureAvailabilities Flag Client Side Availability> - 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 List<FeatureFlag Custom Property> - List of nested blocks describing the feature flag's custom properties. To learn more, read Nested Custom Properties.
- defaults
Feature
Flag Defaults - 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.
- include
In BooleanSnippet - 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 toclient_side_availability.using_environment_id
to maintain future compatability. - maintainer
Id 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.
- List<String>
- Set of feature flag tags.
- temporary Boolean
- Specifies whether the flag is a temporary flag.
- variations
List<Feature
Flag Variation> - 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.
- project
Key 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.
- variation
Type string - The feature flag's variation type:
boolean
,string
,number
orjson
. - archived boolean
- Whether to archive the flag
- client
Side FeatureAvailabilities Flag Client Side Availability[] - 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 FeatureFlag Custom Property[] - List of nested blocks describing the feature flag's custom properties. To learn more, read Nested Custom Properties.
- defaults
Feature
Flag Defaults - 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.
- include
In booleanSnippet - 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 toclient_side_availability.using_environment_id
to maintain future compatability. - maintainer
Id 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.
- string[]
- Set of feature flag tags.
- temporary boolean
- Specifies whether the flag is a temporary flag.
- variations
Feature
Flag Variation[] - 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
orjson
. - archived bool
- Whether to archive the flag
- client_
side_ Sequence[Featureavailabilities Flag Client Side Availability Args] - 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[FeatureFlag Custom Property Args] - List of nested blocks describing the feature flag's custom properties. To learn more, read Nested Custom Properties.
- defaults
Feature
Flag Defaults Args - 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_ boolsnippet - 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 toclient_side_availability.using_environment_id
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.
- Sequence[str]
- Set of feature flag tags.
- temporary bool
- Specifies whether the flag is a temporary flag.
- variations
Sequence[Feature
Flag Variation Args] - 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.
- project
Key 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.
- variation
Type String - The feature flag's variation type:
boolean
,string
,number
orjson
. - archived Boolean
- Whether to archive the flag
- client
Side List<Property Map>Availabilities - 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 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.
- include
In BooleanSnippet - 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 toclient_side_availability.using_environment_id
to maintain future compatability. - maintainer
Id 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.
- 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.
- Archived bool
- Whether to archive the flag
- Client
Side List<Lbrlabs.Availabilities Pulumi Package. Launchdarkly. Inputs. Feature Flag Client Side Availability> - 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 List<Lbrlabs.Pulumi Package. Launchdarkly. Inputs. Feature Flag Custom Property> - List of nested blocks describing the feature flag's custom properties. To learn more, read Nested Custom Properties.
- Defaults
Lbrlabs.
Pulumi Package. Launchdarkly. Inputs. Feature Flag Defaults - 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.
- Include
In boolSnippet - 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 toclient_side_availability.using_environment_id
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.
- Maintainer
Id 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.
- Project
Key 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.
- List<string>
- Set of feature flag tags.
- Temporary bool
- Specifies whether the flag is a temporary flag.
- Variation
Type string - The feature flag's variation type:
boolean
,string
,number
orjson
. - Variations
List<Lbrlabs.
Pulumi Package. Launchdarkly. Inputs. Feature Flag Variation> - 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 []FeatureAvailabilities Flag Client Side Availability Args - 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 []FeatureFlag Custom Property Args - List of nested blocks describing the feature flag's custom properties. To learn more, read Nested Custom Properties.
- Defaults
Feature
Flag Defaults Args - 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.
- Include
In boolSnippet - 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 toclient_side_availability.using_environment_id
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.
- Maintainer
Id 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.
- Project
Key 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.
- []string
- Set of feature flag tags.
- Temporary bool
- Specifies whether the flag is a temporary flag.
- Variation
Type string - The feature flag's variation type:
boolean
,string
,number
orjson
. - Variations
[]Feature
Flag Variation Args - 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
- client
Side List<FeatureAvailabilities Flag Client Side Availability> - 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 List<FeatureFlag Custom Property> - List of nested blocks describing the feature flag's custom properties. To learn more, read Nested Custom Properties.
- defaults
Feature
Flag Defaults - 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.
- include
In BooleanSnippet - 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 toclient_side_availability.using_environment_id
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.
- maintainer
Id 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.
- project
Key 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.
- List<String>
- Set of feature flag tags.
- temporary Boolean
- Specifies whether the flag is a temporary flag.
- variation
Type String - The feature flag's variation type:
boolean
,string
,number
orjson
. - variations
List<Feature
Flag Variation> - 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
- client
Side FeatureAvailabilities Flag Client Side Availability[] - 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 FeatureFlag Custom Property[] - List of nested blocks describing the feature flag's custom properties. To learn more, read Nested Custom Properties.
- defaults
Feature
Flag Defaults - 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.
- include
In booleanSnippet - 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 toclient_side_availability.using_environment_id
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.
- maintainer
Id 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.
- project
Key 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.
- string[]
- Set of feature flag tags.
- temporary boolean
- Specifies whether the flag is a temporary flag.
- variation
Type string - The feature flag's variation type:
boolean
,string
,number
orjson
. - variations
Feature
Flag Variation[] - 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_ Sequence[Featureavailabilities Flag Client Side Availability Args] - 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[FeatureFlag Custom Property Args] - List of nested blocks describing the feature flag's custom properties. To learn more, read Nested Custom Properties.
- defaults
Feature
Flag Defaults Args - 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_ boolsnippet - 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 toclient_side_availability.using_environment_id
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.
- 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
orjson
. - variations
Sequence[Feature
Flag Variation Args] - 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
- client
Side List<Property Map>Availabilities - 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 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.
- include
In BooleanSnippet - 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 toclient_side_availability.using_environment_id
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.
- maintainer
Id 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.
- project
Key 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.
- List<String>
- Set of feature flag tags.
- temporary Boolean
- Specifies whether the flag is a temporary flag.
- variation
Type String - The feature flag's variation type:
boolean
,string
,number
orjson
. - 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, FeatureFlagClientSideAvailabilityArgs
- Using
Environment boolId - Whether this flag is available to SDKs using the client-side ID.
- Using
Mobile boolKey - Whether this flag is available to SDKs using a mobile key.
- Using
Environment boolId - Whether this flag is available to SDKs using the client-side ID.
- Using
Mobile boolKey - Whether this flag is available to SDKs using a mobile key.
- using
Environment BooleanId - Whether this flag is available to SDKs using the client-side ID.
- using
Mobile BooleanKey - Whether this flag is available to SDKs using a mobile key.
- using
Environment booleanId - Whether this flag is available to SDKs using the client-side ID.
- using
Mobile booleanKey - Whether this flag is available to SDKs using a mobile key.
- using_
environment_ boolid - Whether this flag is available to SDKs using the client-side ID.
- using_
mobile_ boolkey - Whether this flag is available to SDKs using a mobile key.
- using
Environment BooleanId - Whether this flag is available to SDKs using the client-side ID.
- using
Mobile BooleanKey - Whether this flag is available to SDKs using a mobile key.
FeatureFlagCustomProperty, FeatureFlagCustomPropertyArgs
FeatureFlagDefaults, FeatureFlagDefaultsArgs
- 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.
- 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.
- off
Variation Integer - The index of the variation the flag will default to in all new environments when off.
- on
Variation Integer - The index of the variation the flag will default to in all new environments when on.
- off
Variation number - The index of the variation the flag will default to in all new environments when off.
- on
Variation 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.
- off
Variation Number - The index of the variation the flag will default to in all new environments when off.
- on
Variation Number - The index of the variation the flag will default to in all new environments when on.
FeatureFlagVariation, FeatureFlagVariationArgs
- Value string
- The variation value. The value's type must correspond to the
variation_type
argument. For example:variation_type = "boolean"
accepts onlytrue
orfalse
. 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
and1.100
will both be converted to1.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 onlytrue
orfalse
. 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
and1.100
will both be converted to1.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 onlytrue
orfalse
. 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
and1.100
will both be converted to1.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 onlytrue
orfalse
. 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
and1.100
will both be converted to1.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 onlytrue
orfalse
. 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
and1.100
will both be converted to1.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 onlytrue
orfalse
. 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
and1.100
will both be converted to1.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
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- launchdarkly lbrlabs/pulumi-launchdarkly
- License
- Notes
- This Pulumi package is based on the
launchdarkly
Terraform Provider.