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 Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var config = new Config();
        var lbTgArn = config.Get("lbTgArn") ?? "";
        var lbTgName = config.Get("lbTgName") ?? "";
        var test = Output.Create(Aws.LB.GetTargetGroup.InvokeAsync(new Aws.LB.GetTargetGroupArgs
        {
            Arn = lbTgArn,
            Name = lbTgName,
        }));
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/lb"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        opt0 := lbTgArn
        opt1 := lbTgName
        _, err := lb.LookupTargetGroup(ctx, &lb.LookupTargetGroupArgs{
            Arn:  &opt0,
            Name: &opt1,
        }, nil)
        if err != nil {
            return err
        }
        return nil
    })
}
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 = pulumi.output(aws.lb.getTargetGroup({
    arn: lbTgArn,
    name: lbTgName,
}, { async: true }));

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

Using GetTargetGroup

function getTargetGroup(args: GetTargetGroupArgs, opts?: InvokeOptions): Promise<GetTargetGroupResult>
function  get_target_group(arn=None, name=None, tags=None, opts=None)
func LookupTargetGroup(ctx *Context, args *LookupTargetGroupArgs, opts ...InvokeOption) (*LookupTargetGroupResult, error)

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

public static class GetTargetGroup {
    public static Task<GetTargetGroupResult> InvokeAsync(GetTargetGroupArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Arn string

The full ARN of the target group.

Name string

The unique name of the target group.

Tags Dictionary<string, string>
Arn string

The full ARN of the target group.

Name string

The unique name of the target group.

Tags map[string]string
arn string

The full ARN of the target group.

name string

The unique name of the target group.

tags {[key: string]: string}
arn str

The full ARN of the target group.

name str

The unique name of the target group.

tags Dict[str, str]

GetTargetGroup Result

The following output properties are available:

Arn string
ArnSuffix string
DeregistrationDelay int
HealthCheck GetTargetGroupHealthCheck
Id string

The provider-assigned unique ID for this managed resource.

LambdaMultiValueHeadersEnabled bool
LoadBalancingAlgorithmType string
Name string
Port int
Protocol string
ProxyProtocolV2 bool
SlowStart int
Stickiness GetTargetGroupStickiness
Tags Dictionary<string, string>
TargetType string
VpcId string
Arn string
ArnSuffix string
DeregistrationDelay int
HealthCheck GetTargetGroupHealthCheck
Id string

The provider-assigned unique ID for this managed resource.

LambdaMultiValueHeadersEnabled bool
LoadBalancingAlgorithmType string
Name string
Port int
Protocol string
ProxyProtocolV2 bool
SlowStart int
Stickiness GetTargetGroupStickiness
Tags map[string]string
TargetType string
VpcId string
arn string
arnSuffix string
deregistrationDelay number
healthCheck GetTargetGroupHealthCheck
id string

The provider-assigned unique ID for this managed resource.

lambdaMultiValueHeadersEnabled boolean
loadBalancingAlgorithmType string
name string
port number
protocol string
proxyProtocolV2 boolean
slowStart number
stickiness GetTargetGroupStickiness
tags {[key: string]: string}
targetType string
vpcId string
arn str
arn_suffix str
deregistration_delay float
health_check Dict[GetTargetGroupHealthCheck]
id str

The provider-assigned unique ID for this managed resource.

lambda_multi_value_headers_enabled bool
load_balancing_algorithm_type str
name str
port float
protocol str
proxy_protocol_v2 bool
slow_start float
stickiness Dict[GetTargetGroupStickiness]
tags Dict[str, str]
target_type str
vpc_id str

Supporting Types

GetTargetGroupHealthCheck

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

Enabled bool
HealthyThreshold int
Interval int
Matcher string
Path string
Port string
Protocol string
Timeout int
UnhealthyThreshold int
Enabled bool
HealthyThreshold int
Interval int
Matcher string
Path string
Port string
Protocol string
Timeout int
UnhealthyThreshold int
enabled boolean
healthyThreshold number
interval number
matcher string
path string
port string
protocol string
timeout number
unhealthyThreshold number
enabled bool
healthyThreshold float
interval float
matcher str
path str
port str
protocol str
timeout float
unhealthyThreshold float

GetTargetGroupStickiness

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

CookieDuration int
Enabled bool
Type string
CookieDuration int
Enabled bool
Type string
cookieDuration number
enabled boolean
type string
cookieDuration float
enabled bool
type str

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.