1. Packages
  2. Launch Darkly
  3. API Docs
  4. getFeatureFlagEnvironment
Launch Darkly v0.0.6 published on Sunday, Feb 19, 2023 by lbrlabs

launchdarkly.getFeatureFlagEnvironment

Explore with Pulumi AI

Provides a LaunchDarkly environment-specific feature flag data source.

This data source allows you to retrieve environment-specific feature flag information from your LaunchDarkly organization.

Example Usage

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

return await Deployment.RunAsync(() => 
{
    var example = Launchdarkly.GetFeatureFlagEnvironment.Invoke(new()
    {
        EnvKey = "example-env",
        FlagId = "example-project/example-flag",
    });

});
Copy
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.LookupFeatureFlagEnvironment(ctx, &launchdarkly.LookupFeatureFlagEnvironmentArgs{
			EnvKey: "example-env",
			FlagId: "example-project/example-flag",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.launchdarkly.LaunchdarklyFunctions;
import com.pulumi.launchdarkly.inputs.GetFeatureFlagEnvironmentArgs;
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) {
        final var example = LaunchdarklyFunctions.getFeatureFlagEnvironment(GetFeatureFlagEnvironmentArgs.builder()
            .envKey("example-env")
            .flagId("example-project/example-flag")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as launchdarkly from "@pulumi/launchdarkly";

const example = launchdarkly.getFeatureFlagEnvironment({
    envKey: "example-env",
    flagId: "example-project/example-flag",
});
Copy
import pulumi
import pulumi_launchdarkly as launchdarkly

example = launchdarkly.get_feature_flag_environment(env_key="example-env",
    flag_id="example-project/example-flag")
Copy
variables:
  example:
    fn::invoke:
      Function: launchdarkly:getFeatureFlagEnvironment
      Arguments:
        envKey: example-env
        flagId: example-project/example-flag
Copy

Using getFeatureFlagEnvironment

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getFeatureFlagEnvironment(args: GetFeatureFlagEnvironmentArgs, opts?: InvokeOptions): Promise<GetFeatureFlagEnvironmentResult>
function getFeatureFlagEnvironmentOutput(args: GetFeatureFlagEnvironmentOutputArgs, opts?: InvokeOptions): Output<GetFeatureFlagEnvironmentResult>
Copy
def get_feature_flag_environment(env_key: Optional[str] = None,
                                 fallthrough: Optional[GetFeatureFlagEnvironmentFallthrough] = None,
                                 flag_id: Optional[str] = None,
                                 off_variation: Optional[int] = None,
                                 on: Optional[bool] = None,
                                 prerequisites: Optional[Sequence[GetFeatureFlagEnvironmentPrerequisite]] = None,
                                 rules: Optional[Sequence[GetFeatureFlagEnvironmentRule]] = None,
                                 targets: Optional[Sequence[GetFeatureFlagEnvironmentTarget]] = None,
                                 track_events: Optional[bool] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetFeatureFlagEnvironmentResult
def get_feature_flag_environment_output(env_key: Optional[pulumi.Input[str]] = None,
                                 fallthrough: Optional[pulumi.Input[GetFeatureFlagEnvironmentFallthroughArgs]] = None,
                                 flag_id: Optional[pulumi.Input[str]] = None,
                                 off_variation: Optional[pulumi.Input[int]] = None,
                                 on: Optional[pulumi.Input[bool]] = None,
                                 prerequisites: Optional[pulumi.Input[Sequence[pulumi.Input[GetFeatureFlagEnvironmentPrerequisiteArgs]]]] = None,
                                 rules: Optional[pulumi.Input[Sequence[pulumi.Input[GetFeatureFlagEnvironmentRuleArgs]]]] = None,
                                 targets: Optional[pulumi.Input[Sequence[pulumi.Input[GetFeatureFlagEnvironmentTargetArgs]]]] = None,
                                 track_events: Optional[pulumi.Input[bool]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetFeatureFlagEnvironmentResult]
Copy
func LookupFeatureFlagEnvironment(ctx *Context, args *LookupFeatureFlagEnvironmentArgs, opts ...InvokeOption) (*LookupFeatureFlagEnvironmentResult, error)
func LookupFeatureFlagEnvironmentOutput(ctx *Context, args *LookupFeatureFlagEnvironmentOutputArgs, opts ...InvokeOption) LookupFeatureFlagEnvironmentResultOutput
Copy

> Note: This function is named LookupFeatureFlagEnvironment in the Go SDK.

public static class GetFeatureFlagEnvironment 
{
    public static Task<GetFeatureFlagEnvironmentResult> InvokeAsync(GetFeatureFlagEnvironmentArgs args, InvokeOptions? opts = null)
    public static Output<GetFeatureFlagEnvironmentResult> Invoke(GetFeatureFlagEnvironmentInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetFeatureFlagEnvironmentResult> getFeatureFlagEnvironment(GetFeatureFlagEnvironmentArgs args, InvokeOptions options)
public static Output<GetFeatureFlagEnvironmentResult> getFeatureFlagEnvironment(GetFeatureFlagEnvironmentArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: launchdarkly:index/getFeatureFlagEnvironment:getFeatureFlagEnvironment
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

EnvKey
This property is required.
Changes to this property will trigger replacement.
string
The environment key.
FlagId
This property is required.
Changes to this property will trigger replacement.
string
The feature flag's unique id in the format project_key/flag_key.
Fallthrough Lbrlabs.PulumiPackage.Launchdarkly.Inputs.GetFeatureFlagEnvironmentFallthrough
OffVariation int
The index of the variation served when targeting is disabled.
On bool
Whether targeting is enabled.
Prerequisites List<Lbrlabs.PulumiPackage.Launchdarkly.Inputs.GetFeatureFlagEnvironmentPrerequisite>
List of nested blocks describing prerequisite feature flags rules. To learn more, read Nested Prequisites Blocks.
Rules List<Lbrlabs.PulumiPackage.Launchdarkly.Inputs.GetFeatureFlagEnvironmentRule>
List of logical targeting rules. To learn more, read Nested Rules Blocks.
Targets List<Lbrlabs.PulumiPackage.Launchdarkly.Inputs.GetFeatureFlagEnvironmentTarget>
TrackEvents bool
Whether event data will be sent back to LaunchDarkly.
EnvKey
This property is required.
Changes to this property will trigger replacement.
string
The environment key.
FlagId
This property is required.
Changes to this property will trigger replacement.
string
The feature flag's unique id in the format project_key/flag_key.
Fallthrough GetFeatureFlagEnvironmentFallthrough
OffVariation int
The index of the variation served when targeting is disabled.
On bool
Whether targeting is enabled.
Prerequisites []GetFeatureFlagEnvironmentPrerequisite
List of nested blocks describing prerequisite feature flags rules. To learn more, read Nested Prequisites Blocks.
Rules []GetFeatureFlagEnvironmentRule
List of logical targeting rules. To learn more, read Nested Rules Blocks.
Targets []GetFeatureFlagEnvironmentTarget
TrackEvents bool
Whether event data will be sent back to LaunchDarkly.
envKey
This property is required.
Changes to this property will trigger replacement.
String
The environment key.
flagId
This property is required.
Changes to this property will trigger replacement.
String
The feature flag's unique id in the format project_key/flag_key.
fallthrough GetFeatureFlagEnvironmentFallthrough
offVariation Integer
The index of the variation served when targeting is disabled.
on Boolean
Whether targeting is enabled.
prerequisites List<GetFeatureFlagEnvironmentPrerequisite>
List of nested blocks describing prerequisite feature flags rules. To learn more, read Nested Prequisites Blocks.
rules List<GetFeatureFlagEnvironmentRule>
List of logical targeting rules. To learn more, read Nested Rules Blocks.
targets List<GetFeatureFlagEnvironmentTarget>
trackEvents Boolean
Whether event data will be sent back to LaunchDarkly.
envKey
This property is required.
Changes to this property will trigger replacement.
string
The environment key.
flagId
This property is required.
Changes to this property will trigger replacement.
string
The feature flag's unique id in the format project_key/flag_key.
fallthrough GetFeatureFlagEnvironmentFallthrough
offVariation number
The index of the variation served when targeting is disabled.
on boolean
Whether targeting is enabled.
prerequisites GetFeatureFlagEnvironmentPrerequisite[]
List of nested blocks describing prerequisite feature flags rules. To learn more, read Nested Prequisites Blocks.
rules GetFeatureFlagEnvironmentRule[]
List of logical targeting rules. To learn more, read Nested Rules Blocks.
targets GetFeatureFlagEnvironmentTarget[]
trackEvents boolean
Whether event data will be sent back to LaunchDarkly.
env_key
This property is required.
Changes to this property will trigger replacement.
str
The environment key.
flag_id
This property is required.
Changes to this property will trigger replacement.
str
The feature flag's unique id in the format project_key/flag_key.
fallthrough GetFeatureFlagEnvironmentFallthrough
off_variation int
The index of the variation served when targeting is disabled.
on bool
Whether targeting is enabled.
prerequisites Sequence[GetFeatureFlagEnvironmentPrerequisite]
List of nested blocks describing prerequisite feature flags rules. To learn more, read Nested Prequisites Blocks.
rules Sequence[GetFeatureFlagEnvironmentRule]
List of logical targeting rules. To learn more, read Nested Rules Blocks.
targets Sequence[GetFeatureFlagEnvironmentTarget]
track_events bool
Whether event data will be sent back to LaunchDarkly.
envKey
This property is required.
Changes to this property will trigger replacement.
String
The environment key.
flagId
This property is required.
Changes to this property will trigger replacement.
String
The feature flag's unique id in the format project_key/flag_key.
fallthrough Property Map
offVariation Number
The index of the variation served when targeting is disabled.
on Boolean
Whether targeting is enabled.
prerequisites List<Property Map>
List of nested blocks describing prerequisite feature flags rules. To learn more, read Nested Prequisites Blocks.
rules List<Property Map>
List of logical targeting rules. To learn more, read Nested Rules Blocks.
targets List<Property Map>
trackEvents Boolean
Whether event data will be sent back to LaunchDarkly.

getFeatureFlagEnvironment Result

The following output properties are available:

EnvKey string
FlagId string
Id string
The provider-assigned unique ID for this managed resource.
Fallthrough Lbrlabs.PulumiPackage.Launchdarkly.Outputs.GetFeatureFlagEnvironmentFallthrough
OffVariation int
The index of the variation served when targeting is disabled.
On bool
Whether targeting is enabled.
Prerequisites List<Lbrlabs.PulumiPackage.Launchdarkly.Outputs.GetFeatureFlagEnvironmentPrerequisite>
List of nested blocks describing prerequisite feature flags rules. To learn more, read Nested Prequisites Blocks.
Rules List<Lbrlabs.PulumiPackage.Launchdarkly.Outputs.GetFeatureFlagEnvironmentRule>
List of logical targeting rules. To learn more, read Nested Rules Blocks.
Targets List<Lbrlabs.PulumiPackage.Launchdarkly.Outputs.GetFeatureFlagEnvironmentTarget>
TrackEvents bool
Whether event data will be sent back to LaunchDarkly.
EnvKey string
FlagId string
Id string
The provider-assigned unique ID for this managed resource.
Fallthrough GetFeatureFlagEnvironmentFallthrough
OffVariation int
The index of the variation served when targeting is disabled.
On bool
Whether targeting is enabled.
Prerequisites []GetFeatureFlagEnvironmentPrerequisite
List of nested blocks describing prerequisite feature flags rules. To learn more, read Nested Prequisites Blocks.
Rules []GetFeatureFlagEnvironmentRule
List of logical targeting rules. To learn more, read Nested Rules Blocks.
Targets []GetFeatureFlagEnvironmentTarget
TrackEvents bool
Whether event data will be sent back to LaunchDarkly.
envKey String
flagId String
id String
The provider-assigned unique ID for this managed resource.
fallthrough GetFeatureFlagEnvironmentFallthrough
offVariation Integer
The index of the variation served when targeting is disabled.
on Boolean
Whether targeting is enabled.
prerequisites List<GetFeatureFlagEnvironmentPrerequisite>
List of nested blocks describing prerequisite feature flags rules. To learn more, read Nested Prequisites Blocks.
rules List<GetFeatureFlagEnvironmentRule>
List of logical targeting rules. To learn more, read Nested Rules Blocks.
targets List<GetFeatureFlagEnvironmentTarget>
trackEvents Boolean
Whether event data will be sent back to LaunchDarkly.
envKey string
flagId string
id string
The provider-assigned unique ID for this managed resource.
fallthrough GetFeatureFlagEnvironmentFallthrough
offVariation number
The index of the variation served when targeting is disabled.
on boolean
Whether targeting is enabled.
prerequisites GetFeatureFlagEnvironmentPrerequisite[]
List of nested blocks describing prerequisite feature flags rules. To learn more, read Nested Prequisites Blocks.
rules GetFeatureFlagEnvironmentRule[]
List of logical targeting rules. To learn more, read Nested Rules Blocks.
targets GetFeatureFlagEnvironmentTarget[]
trackEvents boolean
Whether event data will be sent back to LaunchDarkly.
env_key str
flag_id str
id str
The provider-assigned unique ID for this managed resource.
fallthrough GetFeatureFlagEnvironmentFallthrough
off_variation int
The index of the variation served when targeting is disabled.
on bool
Whether targeting is enabled.
prerequisites Sequence[GetFeatureFlagEnvironmentPrerequisite]
List of nested blocks describing prerequisite feature flags rules. To learn more, read Nested Prequisites Blocks.
rules Sequence[GetFeatureFlagEnvironmentRule]
List of logical targeting rules. To learn more, read Nested Rules Blocks.
targets Sequence[GetFeatureFlagEnvironmentTarget]
track_events bool
Whether event data will be sent back to LaunchDarkly.
envKey String
flagId String
id String
The provider-assigned unique ID for this managed resource.
fallthrough Property Map
offVariation Number
The index of the variation served when targeting is disabled.
on Boolean
Whether targeting is enabled.
prerequisites List<Property Map>
List of nested blocks describing prerequisite feature flags rules. To learn more, read Nested Prequisites Blocks.
rules List<Property Map>
List of logical targeting rules. To learn more, read Nested Rules Blocks.
targets List<Property Map>
trackEvents Boolean
Whether event data will be sent back to LaunchDarkly.

Supporting Types

GetFeatureFlagEnvironmentFallthrough

BucketBy string
Group percentage rollout by a custom attribute.
RolloutWeights List<int>
List of integer percentage rollout weights applied to each variation when the rule clauses evaluates to true.
Variation int
The integer variation index served when the rule clauses evaluate to true.
BucketBy string
Group percentage rollout by a custom attribute.
RolloutWeights []int
List of integer percentage rollout weights applied to each variation when the rule clauses evaluates to true.
Variation int
The integer variation index served when the rule clauses evaluate to true.
bucketBy String
Group percentage rollout by a custom attribute.
rolloutWeights List<Integer>
List of integer percentage rollout weights applied to each variation when the rule clauses evaluates to true.
variation Integer
The integer variation index served when the rule clauses evaluate to true.
bucketBy string
Group percentage rollout by a custom attribute.
rolloutWeights number[]
List of integer percentage rollout weights applied to each variation when the rule clauses evaluates to true.
variation number
The integer variation index served when the rule clauses evaluate to true.
bucket_by str
Group percentage rollout by a custom attribute.
rollout_weights Sequence[int]
List of integer percentage rollout weights applied to each variation when the rule clauses evaluates to true.
variation int
The integer variation index served when the rule clauses evaluate to true.
bucketBy String
Group percentage rollout by a custom attribute.
rolloutWeights List<Number>
List of integer percentage rollout weights applied to each variation when the rule clauses evaluates to true.
variation Number
The integer variation index served when the rule clauses evaluate to true.

GetFeatureFlagEnvironmentPrerequisite

FlagKey This property is required. string
The prerequisite feature flag's key.
Variation This property is required. int
The integer variation index served when the rule clauses evaluate to true.
FlagKey This property is required. string
The prerequisite feature flag's key.
Variation This property is required. int
The integer variation index served when the rule clauses evaluate to true.
flagKey This property is required. String
The prerequisite feature flag's key.
variation This property is required. Integer
The integer variation index served when the rule clauses evaluate to true.
flagKey This property is required. string
The prerequisite feature flag's key.
variation This property is required. number
The integer variation index served when the rule clauses evaluate to true.
flag_key This property is required. str
The prerequisite feature flag's key.
variation This property is required. int
The integer variation index served when the rule clauses evaluate to true.
flagKey This property is required. String
The prerequisite feature flag's key.
variation This property is required. Number
The integer variation index served when the rule clauses evaluate to true.

GetFeatureFlagEnvironmentRule

BucketBy string
Group percentage rollout by a custom attribute.
Clauses List<Lbrlabs.PulumiPackage.Launchdarkly.Inputs.GetFeatureFlagEnvironmentRuleClause>
List of nested blocks specifying the logical clauses evaluated. To learn more, read Nested Clauses Blocks.
RolloutWeights List<int>
List of integer percentage rollout weights applied to each variation when the rule clauses evaluates to true.
Variation int
The integer variation index served when the rule clauses evaluate to true.
BucketBy string
Group percentage rollout by a custom attribute.
Clauses []GetFeatureFlagEnvironmentRuleClause
List of nested blocks specifying the logical clauses evaluated. To learn more, read Nested Clauses Blocks.
RolloutWeights []int
List of integer percentage rollout weights applied to each variation when the rule clauses evaluates to true.
Variation int
The integer variation index served when the rule clauses evaluate to true.
bucketBy String
Group percentage rollout by a custom attribute.
clauses List<GetFeatureFlagEnvironmentRuleClause>
List of nested blocks specifying the logical clauses evaluated. To learn more, read Nested Clauses Blocks.
rolloutWeights List<Integer>
List of integer percentage rollout weights applied to each variation when the rule clauses evaluates to true.
variation Integer
The integer variation index served when the rule clauses evaluate to true.
bucketBy string
Group percentage rollout by a custom attribute.
clauses GetFeatureFlagEnvironmentRuleClause[]
List of nested blocks specifying the logical clauses evaluated. To learn more, read Nested Clauses Blocks.
rolloutWeights number[]
List of integer percentage rollout weights applied to each variation when the rule clauses evaluates to true.
variation number
The integer variation index served when the rule clauses evaluate to true.
bucket_by str
Group percentage rollout by a custom attribute.
clauses Sequence[GetFeatureFlagEnvironmentRuleClause]
List of nested blocks specifying the logical clauses evaluated. To learn more, read Nested Clauses Blocks.
rollout_weights Sequence[int]
List of integer percentage rollout weights applied to each variation when the rule clauses evaluates to true.
variation int
The integer variation index served when the rule clauses evaluate to true.
bucketBy String
Group percentage rollout by a custom attribute.
clauses List<Property Map>
List of nested blocks specifying the logical clauses evaluated. To learn more, read Nested Clauses Blocks.
rolloutWeights List<Number>
List of integer percentage rollout weights applied to each variation when the rule clauses evaluates to true.
variation Number
The integer variation index served when the rule clauses evaluate to true.

GetFeatureFlagEnvironmentRuleClause

Attribute This property is required. string
The user attribute operated on.
Op This property is required. string
The operator associated with the rule clause. This will be one of in, endsWith, startsWith, matches, contains, lessThan, lessThanOrEqual, greaterThanOrEqual, before, after, segmentMatch, semVerEqual, semVerLessThan, and semVerGreaterThan.
Values This property is required. List<string>
The list of values associated with the rule clause.
Negate bool
Whether the rule clause is negated.
ValueType string
The type for each of the clause's values. Available types are boolean, string, and number.
Attribute This property is required. string
The user attribute operated on.
Op This property is required. string
The operator associated with the rule clause. This will be one of in, endsWith, startsWith, matches, contains, lessThan, lessThanOrEqual, greaterThanOrEqual, before, after, segmentMatch, semVerEqual, semVerLessThan, and semVerGreaterThan.
Values This property is required. []string
The list of values associated with the rule clause.
Negate bool
Whether the rule clause is negated.
ValueType string
The type for each of the clause's values. Available types are boolean, string, and number.
attribute This property is required. String
The user attribute operated on.
op This property is required. String
The operator associated with the rule clause. This will be one of in, endsWith, startsWith, matches, contains, lessThan, lessThanOrEqual, greaterThanOrEqual, before, after, segmentMatch, semVerEqual, semVerLessThan, and semVerGreaterThan.
values This property is required. List<String>
The list of values associated with the rule clause.
negate Boolean
Whether the rule clause is negated.
valueType String
The type for each of the clause's values. Available types are boolean, string, and number.
attribute This property is required. string
The user attribute operated on.
op This property is required. string
The operator associated with the rule clause. This will be one of in, endsWith, startsWith, matches, contains, lessThan, lessThanOrEqual, greaterThanOrEqual, before, after, segmentMatch, semVerEqual, semVerLessThan, and semVerGreaterThan.
values This property is required. string[]
The list of values associated with the rule clause.
negate boolean
Whether the rule clause is negated.
valueType string
The type for each of the clause's values. Available types are boolean, string, and number.
attribute This property is required. str
The user attribute operated on.
op This property is required. str
The operator associated with the rule clause. This will be one of in, endsWith, startsWith, matches, contains, lessThan, lessThanOrEqual, greaterThanOrEqual, before, after, segmentMatch, semVerEqual, semVerLessThan, and semVerGreaterThan.
values This property is required. Sequence[str]
The list of values associated with the rule clause.
negate bool
Whether the rule clause is negated.
value_type str
The type for each of the clause's values. Available types are boolean, string, and number.
attribute This property is required. String
The user attribute operated on.
op This property is required. String
The operator associated with the rule clause. This will be one of in, endsWith, startsWith, matches, contains, lessThan, lessThanOrEqual, greaterThanOrEqual, before, after, segmentMatch, semVerEqual, semVerLessThan, and semVerGreaterThan.
values This property is required. List<String>
The list of values associated with the rule clause.
negate Boolean
Whether the rule clause is negated.
valueType String
The type for each of the clause's values. Available types are boolean, string, and number.

GetFeatureFlagEnvironmentTarget

Values This property is required. List<string>
The list of values associated with the rule clause.
Variation This property is required. int
The integer variation index served when the rule clauses evaluate to true.
Values This property is required. []string
The list of values associated with the rule clause.
Variation This property is required. int
The integer variation index served when the rule clauses evaluate to true.
values This property is required. List<String>
The list of values associated with the rule clause.
variation This property is required. Integer
The integer variation index served when the rule clauses evaluate to true.
values This property is required. string[]
The list of values associated with the rule clause.
variation This property is required. number
The integer variation index served when the rule clauses evaluate to true.
values This property is required. Sequence[str]
The list of values associated with the rule clause.
variation This property is required. int
The integer variation index served when the rule clauses evaluate to true.
values This property is required. List<String>
The list of values associated with the rule clause.
variation This property is required. Number
The integer variation index served when the rule clauses evaluate to true.

Package Details

Repository
launchdarkly lbrlabs/pulumi-launchdarkly
License
Notes
This Pulumi package is based on the launchdarkly Terraform Provider.