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

launchdarkly.getSegment

Explore with Pulumi AI

launchdarkly logo
Launch Darkly v0.0.6 published on Sunday, Feb 19, 2023 by lbrlabs

    Provides a LaunchDarkly segment data source.

    This data source allows you to retrieve segment information from your LaunchDarkly organization.

    Example Usage

    using System.Collections.Generic;
    using Pulumi;
    using Launchdarkly = Pulumi.Launchdarkly;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Launchdarkly.GetSegment.Invoke(new()
        {
            EnvKey = "example-env",
            Key = "example-segment",
            ProjectKey = "example-project",
        });
    
    });
    
    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.LookupSegment(ctx, &launchdarkly.LookupSegmentArgs{
    			EnvKey:     "example-env",
    			Key:        "example-segment",
    			ProjectKey: "example-project",
    		}, nil)
    		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.LaunchdarklyFunctions;
    import com.pulumi.launchdarkly.inputs.GetSegmentArgs;
    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.getSegment(GetSegmentArgs.builder()
                .envKey("example-env")
                .key("example-segment")
                .projectKey("example-project")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_launchdarkly as launchdarkly
    
    example = launchdarkly.get_segment(env_key="example-env",
        key="example-segment",
        project_key="example-project")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as launchdarkly from "@pulumi/launchdarkly";
    
    const example = launchdarkly.getSegment({
        envKey: "example-env",
        key: "example-segment",
        projectKey: "example-project",
    });
    
    variables:
      example:
        fn::invoke:
          Function: launchdarkly:getSegment
          Arguments:
            envKey: example-env
            key: example-segment
            projectKey: example-project
    

    Using getSegment

    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 getSegment(args: GetSegmentArgs, opts?: InvokeOptions): Promise<GetSegmentResult>
    function getSegmentOutput(args: GetSegmentOutputArgs, opts?: InvokeOptions): Output<GetSegmentResult>
    def get_segment(description: Optional[str] = None,
                    env_key: Optional[str] = None,
                    excludeds: Optional[Sequence[str]] = None,
                    includeds: Optional[Sequence[str]] = None,
                    key: Optional[str] = None,
                    project_key: Optional[str] = None,
                    rules: Optional[Sequence[GetSegmentRule]] = None,
                    tags: Optional[Sequence[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> GetSegmentResult
    def get_segment_output(description: Optional[pulumi.Input[str]] = None,
                    env_key: Optional[pulumi.Input[str]] = None,
                    excludeds: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                    includeds: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                    key: Optional[pulumi.Input[str]] = None,
                    project_key: Optional[pulumi.Input[str]] = None,
                    rules: Optional[pulumi.Input[Sequence[pulumi.Input[GetSegmentRuleArgs]]]] = None,
                    tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetSegmentResult]
    func LookupSegment(ctx *Context, args *LookupSegmentArgs, opts ...InvokeOption) (*LookupSegmentResult, error)
    func LookupSegmentOutput(ctx *Context, args *LookupSegmentOutputArgs, opts ...InvokeOption) LookupSegmentResultOutput

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

    public static class GetSegment 
    {
        public static Task<GetSegmentResult> InvokeAsync(GetSegmentArgs args, InvokeOptions? opts = null)
        public static Output<GetSegmentResult> Invoke(GetSegmentInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSegmentResult> getSegment(GetSegmentArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: launchdarkly:index/getSegment:getSegment
      arguments:
        # arguments dictionary

    The following arguments are supported:

    EnvKey string
    The segment's environment key.
    Key string
    The unique key that references the segment.
    ProjectKey string
    The segment's project key.
    Description string
    The description of the segment's purpose.
    Excludeds List<string>
    List of user keys excluded from the segment.
    Includeds List<string>
    List of user keys included in the segment.
    Rules List<Lbrlabs.PulumiPackage.Launchdarkly.Inputs.GetSegmentRule>
    List of nested custom rule blocks to apply to the segment. To learn more, read Nested Rules Blocks.
    Tags List<string>
    Set of tags for the segment.
    EnvKey string
    The segment's environment key.
    Key string
    The unique key that references the segment.
    ProjectKey string
    The segment's project key.
    Description string
    The description of the segment's purpose.
    Excludeds []string
    List of user keys excluded from the segment.
    Includeds []string
    List of user keys included in the segment.
    Rules []GetSegmentRule
    List of nested custom rule blocks to apply to the segment. To learn more, read Nested Rules Blocks.
    Tags []string
    Set of tags for the segment.
    envKey String
    The segment's environment key.
    key String
    The unique key that references the segment.
    projectKey String
    The segment's project key.
    description String
    The description of the segment's purpose.
    excludeds List<String>
    List of user keys excluded from the segment.
    includeds List<String>
    List of user keys included in the segment.
    rules List<GetSegmentRule>
    List of nested custom rule blocks to apply to the segment. To learn more, read Nested Rules Blocks.
    tags List<String>
    Set of tags for the segment.
    envKey string
    The segment's environment key.
    key string
    The unique key that references the segment.
    projectKey string
    The segment's project key.
    description string
    The description of the segment's purpose.
    excludeds string[]
    List of user keys excluded from the segment.
    includeds string[]
    List of user keys included in the segment.
    rules GetSegmentRule[]
    List of nested custom rule blocks to apply to the segment. To learn more, read Nested Rules Blocks.
    tags string[]
    Set of tags for the segment.
    env_key str
    The segment's environment key.
    key str
    The unique key that references the segment.
    project_key str
    The segment's project key.
    description str
    The description of the segment's purpose.
    excludeds Sequence[str]
    List of user keys excluded from the segment.
    includeds Sequence[str]
    List of user keys included in the segment.
    rules Sequence[GetSegmentRule]
    List of nested custom rule blocks to apply to the segment. To learn more, read Nested Rules Blocks.
    tags Sequence[str]
    Set of tags for the segment.
    envKey String
    The segment's environment key.
    key String
    The unique key that references the segment.
    projectKey String
    The segment's project key.
    description String
    The description of the segment's purpose.
    excludeds List<String>
    List of user keys excluded from the segment.
    includeds List<String>
    List of user keys included in the segment.
    rules List<Property Map>
    List of nested custom rule blocks to apply to the segment. To learn more, read Nested Rules Blocks.
    tags List<String>
    Set of tags for the segment.

    getSegment Result

    The following output properties are available:

    CreationDate int
    The segment's creation date represented as a UNIX epoch timestamp.
    EnvKey string
    Id string
    The provider-assigned unique ID for this managed resource.
    Key string
    Name string
    The human-friendly name for the segment.
    ProjectKey string
    Description string
    The description of the segment's purpose.
    Excludeds List<string>
    List of user keys excluded from the segment.
    Includeds List<string>
    List of user keys included in the segment.
    Rules List<Lbrlabs.PulumiPackage.Launchdarkly.Outputs.GetSegmentRule>
    List of nested custom rule blocks to apply to the segment. To learn more, read Nested Rules Blocks.
    Tags List<string>
    Set of tags for the segment.
    CreationDate int
    The segment's creation date represented as a UNIX epoch timestamp.
    EnvKey string
    Id string
    The provider-assigned unique ID for this managed resource.
    Key string
    Name string
    The human-friendly name for the segment.
    ProjectKey string
    Description string
    The description of the segment's purpose.
    Excludeds []string
    List of user keys excluded from the segment.
    Includeds []string
    List of user keys included in the segment.
    Rules []GetSegmentRule
    List of nested custom rule blocks to apply to the segment. To learn more, read Nested Rules Blocks.
    Tags []string
    Set of tags for the segment.
    creationDate Integer
    The segment's creation date represented as a UNIX epoch timestamp.
    envKey String
    id String
    The provider-assigned unique ID for this managed resource.
    key String
    name String
    The human-friendly name for the segment.
    projectKey String
    description String
    The description of the segment's purpose.
    excludeds List<String>
    List of user keys excluded from the segment.
    includeds List<String>
    List of user keys included in the segment.
    rules List<GetSegmentRule>
    List of nested custom rule blocks to apply to the segment. To learn more, read Nested Rules Blocks.
    tags List<String>
    Set of tags for the segment.
    creationDate number
    The segment's creation date represented as a UNIX epoch timestamp.
    envKey string
    id string
    The provider-assigned unique ID for this managed resource.
    key string
    name string
    The human-friendly name for the segment.
    projectKey string
    description string
    The description of the segment's purpose.
    excludeds string[]
    List of user keys excluded from the segment.
    includeds string[]
    List of user keys included in the segment.
    rules GetSegmentRule[]
    List of nested custom rule blocks to apply to the segment. To learn more, read Nested Rules Blocks.
    tags string[]
    Set of tags for the segment.
    creation_date int
    The segment's creation date represented as a UNIX epoch timestamp.
    env_key str
    id str
    The provider-assigned unique ID for this managed resource.
    key str
    name str
    The human-friendly name for the segment.
    project_key str
    description str
    The description of the segment's purpose.
    excludeds Sequence[str]
    List of user keys excluded from the segment.
    includeds Sequence[str]
    List of user keys included in the segment.
    rules Sequence[GetSegmentRule]
    List of nested custom rule blocks to apply to the segment. To learn more, read Nested Rules Blocks.
    tags Sequence[str]
    Set of tags for the segment.
    creationDate Number
    The segment's creation date represented as a UNIX epoch timestamp.
    envKey String
    id String
    The provider-assigned unique ID for this managed resource.
    key String
    name String
    The human-friendly name for the segment.
    projectKey String
    description String
    The description of the segment's purpose.
    excludeds List<String>
    List of user keys excluded from the segment.
    includeds List<String>
    List of user keys included in the segment.
    rules List<Property Map>
    List of nested custom rule blocks to apply to the segment. To learn more, read Nested Rules Blocks.
    tags List<String>
    Set of tags for the segment.

    Supporting Types

    GetSegmentRule

    BucketBy string
    The attribute by which to group users together.
    Clauses List<Lbrlabs.PulumiPackage.Launchdarkly.Inputs.GetSegmentRuleClause>
    List of nested custom rule clause blocks. To learn more, read Nested Clauses Blocks.
    Weight int
    The integer weight of the rule (between 0 and 100000).
    BucketBy string
    The attribute by which to group users together.
    Clauses []GetSegmentRuleClause
    List of nested custom rule clause blocks. To learn more, read Nested Clauses Blocks.
    Weight int
    The integer weight of the rule (between 0 and 100000).
    bucketBy String
    The attribute by which to group users together.
    clauses List<GetSegmentRuleClause>
    List of nested custom rule clause blocks. To learn more, read Nested Clauses Blocks.
    weight Integer
    The integer weight of the rule (between 0 and 100000).
    bucketBy string
    The attribute by which to group users together.
    clauses GetSegmentRuleClause[]
    List of nested custom rule clause blocks. To learn more, read Nested Clauses Blocks.
    weight number
    The integer weight of the rule (between 0 and 100000).
    bucket_by str
    The attribute by which to group users together.
    clauses Sequence[GetSegmentRuleClause]
    List of nested custom rule clause blocks. To learn more, read Nested Clauses Blocks.
    weight int
    The integer weight of the rule (between 0 and 100000).
    bucketBy String
    The attribute by which to group users together.
    clauses List<Property Map>
    List of nested custom rule clause blocks. To learn more, read Nested Clauses Blocks.
    weight Number
    The integer weight of the rule (between 0 and 100000).

    GetSegmentRuleClause

    Attribute string
    The user attribute operated on.
    Op 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 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 string
    The user attribute operated on.
    Op 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 []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 String
    The user attribute operated on.
    op 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 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 string
    The user attribute operated on.
    op 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 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 str
    The user attribute operated on.
    op 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 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 String
    The user attribute operated on.
    op 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 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.

    Package Details

    Repository
    launchdarkly lbrlabs/pulumi-launchdarkly
    License
    Notes
    This Pulumi package is based on the launchdarkly Terraform Provider.
    launchdarkly logo
    Launch Darkly v0.0.6 published on Sunday, Feb 19, 2023 by lbrlabs