1. Packages
  2. AWS Classic
  3. API Docs
  4. applicationloadbalancing
  5. getTargetGroup

Try AWS Native preview for resources not in the classic version.

AWS Classic v5.41.0 published on Monday, May 15, 2023 by Pulumi

aws.applicationloadbalancing.getTargetGroup

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v5.41.0 published on Monday, May 15, 2023 by Pulumi

    Deprecated:

    aws.applicationloadbalancing.getTargetGroup has been deprecated in favor of aws.alb.getTargetGroup

    Note: aws.alb.TargetGroup is known as aws.lb.TargetGroup. The functionality is identical.

    Provides information about a Load Balancer Target Group.

    This data source can prove useful when a module accepts an LB Target Group as an input variable and needs to know its attributes. It can also be used to get the ARN of an LB Target Group for use in other resources, given LB Target Group name.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var lbTgArn = config.Get("lbTgArn") ?? "";
        var lbTgName = config.Get("lbTgName") ?? "";
        var test = Aws.LB.GetTargetGroup.Invoke(new()
        {
            Arn = lbTgArn,
            Name = lbTgName,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/lb"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		lbTgArn := ""
    		if param := cfg.Get("lbTgArn"); param != "" {
    			lbTgArn = param
    		}
    		lbTgName := ""
    		if param := cfg.Get("lbTgName"); param != "" {
    			lbTgName = param
    		}
    		_, err := lb.LookupTargetGroup(ctx, &lb.LookupTargetGroupArgs{
    			Arn:  pulumi.StringRef(lbTgArn),
    			Name: pulumi.StringRef(lbTgName),
    		}, 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.aws.lb.LbFunctions;
    import com.pulumi.aws.lb.inputs.GetTargetGroupArgs;
    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 config = ctx.config();
            final var lbTgArn = config.get("lbTgArn").orElse("");
            final var lbTgName = config.get("lbTgName").orElse("");
            final var test = LbFunctions.getTargetGroup(GetTargetGroupArgs.builder()
                .arn(lbTgArn)
                .name(lbTgName)
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    config = pulumi.Config()
    lb_tg_arn = config.get("lbTgArn")
    if lb_tg_arn is None:
        lb_tg_arn = ""
    lb_tg_name = config.get("lbTgName")
    if lb_tg_name is None:
        lb_tg_name = ""
    test = aws.lb.get_target_group(arn=lb_tg_arn,
        name=lb_tg_name)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const config = new pulumi.Config();
    const lbTgArn = config.get("lbTgArn") || "";
    const lbTgName = config.get("lbTgName") || "";
    const test = aws.lb.getTargetGroup({
        arn: lbTgArn,
        name: lbTgName,
    });
    
    configuration:
      lbTgArn:
        type: string
        default:
      lbTgName:
        type: string
        default:
    variables:
      test:
        fn::invoke:
          Function: aws:lb:getTargetGroup
          Arguments:
            arn: ${lbTgArn}
            name: ${lbTgName}
    

    Using getTargetGroup

    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 getTargetGroup(args: GetTargetGroupArgs, opts?: InvokeOptions): Promise<GetTargetGroupResult>
    function getTargetGroupOutput(args: GetTargetGroupOutputArgs, opts?: InvokeOptions): Output<GetTargetGroupResult>
    def get_target_group(arn: Optional[str] = None,
                         name: Optional[str] = None,
                         tags: Optional[Mapping[str, str]] = None,
                         opts: Optional[InvokeOptions] = None) -> GetTargetGroupResult
    def get_target_group_output(arn: Optional[pulumi.Input[str]] = None,
                         name: Optional[pulumi.Input[str]] = None,
                         tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetTargetGroupResult]
    func LookupTargetGroup(ctx *Context, args *LookupTargetGroupArgs, opts ...InvokeOption) (*LookupTargetGroupResult, error)
    func LookupTargetGroupOutput(ctx *Context, args *LookupTargetGroupOutputArgs, opts ...InvokeOption) LookupTargetGroupResultOutput

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

    public static class GetTargetGroup 
    {
        public static Task<GetTargetGroupResult> InvokeAsync(GetTargetGroupArgs args, InvokeOptions? opts = null)
        public static Output<GetTargetGroupResult> Invoke(GetTargetGroupInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetTargetGroupResult> getTargetGroup(GetTargetGroupArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:applicationloadbalancing/getTargetGroup:getTargetGroup
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Arn string

    Full ARN of the target group.

    Name string

    Unique name of the target group.

    Tags Dictionary<string, string>

    Mapping of tags, each pair of which must exactly match a pair on the desired target group.

    Arn string

    Full ARN of the target group.

    Name string

    Unique name of the target group.

    Tags map[string]string

    Mapping of tags, each pair of which must exactly match a pair on the desired target group.

    arn String

    Full ARN of the target group.

    name String

    Unique name of the target group.

    tags Map<String,String>

    Mapping of tags, each pair of which must exactly match a pair on the desired target group.

    arn string

    Full ARN of the target group.

    name string

    Unique name of the target group.

    tags {[key: string]: string}

    Mapping of tags, each pair of which must exactly match a pair on the desired target group.

    arn str

    Full ARN of the target group.

    name str

    Unique name of the target group.

    tags Mapping[str, str]

    Mapping of tags, each pair of which must exactly match a pair on the desired target group.

    arn String

    Full ARN of the target group.

    name String

    Unique name of the target group.

    tags Map<String>

    Mapping of tags, each pair of which must exactly match a pair on the desired target group.

    getTargetGroup Result

    The following output properties are available:

    arn String
    arnSuffix String
    connectionTermination Boolean
    deregistrationDelay Integer
    healthCheck GetTargetGroupHealthCheck
    id String

    The provider-assigned unique ID for this managed resource.

    lambdaMultiValueHeadersEnabled Boolean
    loadBalancingAlgorithmType String
    loadBalancingCrossZoneEnabled String
    name String
    port Integer
    preserveClientIp String
    protocol String
    protocolVersion String
    proxyProtocolV2 Boolean
    slowStart Integer
    stickiness GetTargetGroupStickiness
    tags Map<String,String>
    targetType String
    vpcId String
    arn string
    arnSuffix string
    connectionTermination boolean
    deregistrationDelay number
    healthCheck GetTargetGroupHealthCheck
    id string

    The provider-assigned unique ID for this managed resource.

    lambdaMultiValueHeadersEnabled boolean
    loadBalancingAlgorithmType string
    loadBalancingCrossZoneEnabled string
    name string
    port number
    preserveClientIp string
    protocol string
    protocolVersion string
    proxyProtocolV2 boolean
    slowStart number
    stickiness GetTargetGroupStickiness
    tags {[key: string]: string}
    targetType string
    vpcId string
    arn String
    arnSuffix String
    connectionTermination Boolean
    deregistrationDelay Number
    healthCheck Property Map
    id String

    The provider-assigned unique ID for this managed resource.

    lambdaMultiValueHeadersEnabled Boolean
    loadBalancingAlgorithmType String
    loadBalancingCrossZoneEnabled String
    name String
    port Number
    preserveClientIp String
    protocol String
    protocolVersion String
    proxyProtocolV2 Boolean
    slowStart Number
    stickiness Property Map
    tags Map<String>
    targetType String
    vpcId String

    Supporting Types

    GetTargetGroupHealthCheck

    enabled Boolean
    healthyThreshold Integer
    interval Integer
    matcher String
    path String
    port String
    protocol String
    timeout Integer
    unhealthyThreshold Integer
    enabled boolean
    healthyThreshold number
    interval number
    matcher string
    path string
    port string
    protocol string
    timeout number
    unhealthyThreshold number
    enabled Boolean
    healthyThreshold Number
    interval Number
    matcher String
    path String
    port String
    protocol String
    timeout Number
    unhealthyThreshold Number

    GetTargetGroupStickiness

    cookieDuration Integer
    cookieName String
    enabled Boolean
    type String
    cookieDuration number
    cookieName string
    enabled boolean
    type string
    cookieDuration Number
    cookieName String
    enabled Boolean
    type String

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the aws Terraform Provider.

    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v5.41.0 published on Monday, May 15, 2023 by Pulumi