aws.alb.getTargetGroup
Explore with Pulumi AI
Note:
aws.alb.TargetGroupis known asaws.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
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,
});
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)
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/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
	})
}
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 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());
    }
}
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,
                     load_balancing_anomaly_mitigation: 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,
                     load_balancing_anomaly_mitigation: 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)
public static Output<GetTargetGroupResult> getTargetGroup(GetTargetGroupArgs args, InvokeOptions options)
fn::invoke:
  function: aws:alb/getTargetGroup:getTargetGroup
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Arn string
- Full ARN of the target group.
- LoadBalancing stringAnomaly Mitigation 
- Name string
- Unique name of the target group.
- Dictionary<string, string>
- Mapping of tags, each pair of which must exactly match a pair on the desired target group. - NOTE: When both - arnand- nameare specified,- arntakes precedence.- tagshas the lowest precedence.
- Arn string
- Full ARN of the target group.
- LoadBalancing stringAnomaly Mitigation 
- Name string
- Unique name of the target group.
- map[string]string
- Mapping of tags, each pair of which must exactly match a pair on the desired target group. - NOTE: When both - arnand- nameare specified,- arntakes precedence.- tagshas the lowest precedence.
- arn String
- Full ARN of the target group.
- loadBalancing StringAnomaly Mitigation 
- name String
- Unique name of the target group.
- Map<String,String>
- Mapping of tags, each pair of which must exactly match a pair on the desired target group. - NOTE: When both - arnand- nameare specified,- arntakes precedence.- tagshas the lowest precedence.
- arn string
- Full ARN of the target group.
- loadBalancing stringAnomaly Mitigation 
- name string
- Unique name of the target group.
- {[key: string]: string}
- Mapping of tags, each pair of which must exactly match a pair on the desired target group. - NOTE: When both - arnand- nameare specified,- arntakes precedence.- tagshas the lowest precedence.
- arn str
- Full ARN of the target group.
- load_balancing_ stranomaly_ mitigation 
- name str
- Unique name of the target group.
- Mapping[str, str]
- Mapping of tags, each pair of which must exactly match a pair on the desired target group. - NOTE: When both - arnand- nameare specified,- arntakes precedence.- tagshas the lowest precedence.
- arn String
- Full ARN of the target group.
- loadBalancing StringAnomaly Mitigation 
- name String
- Unique name of the target group.
- Map<String>
- Mapping of tags, each pair of which must exactly match a pair on the desired target group. - NOTE: When both - arnand- nameare specified,- arntakes precedence.- tagshas the lowest precedence.
getTargetGroup Result
The following output properties are available:
- Arn string
- ArnSuffix string
- ConnectionTermination bool
- DeregistrationDelay string
- HealthCheck GetTarget Group Health Check 
- Id string
- The provider-assigned unique ID for this managed resource.
- LambdaMulti boolValue Headers Enabled 
- LoadBalancer List<string>Arns 
- LoadBalancing stringAlgorithm Type 
- LoadBalancing stringAnomaly Mitigation 
- LoadBalancing stringCross Zone Enabled 
- Name string
- Port int
- PreserveClient stringIp 
- Protocol string
- ProtocolVersion string
- ProxyProtocol boolV2 
- SlowStart int
- Stickiness
GetTarget Group Stickiness 
- Dictionary<string, string>
- TargetType string
- VpcId string
- Arn string
- ArnSuffix string
- ConnectionTermination bool
- DeregistrationDelay string
- HealthCheck GetTarget Group Health Check 
- Id string
- The provider-assigned unique ID for this managed resource.
- LambdaMulti boolValue Headers Enabled 
- LoadBalancer []stringArns 
- LoadBalancing stringAlgorithm Type 
- LoadBalancing stringAnomaly Mitigation 
- LoadBalancing stringCross Zone Enabled 
- Name string
- Port int
- PreserveClient stringIp 
- Protocol string
- ProtocolVersion string
- ProxyProtocol boolV2 
- SlowStart int
- Stickiness
GetTarget Group Stickiness 
- map[string]string
- TargetType string
- VpcId string
- arn String
- arnSuffix String
- connectionTermination Boolean
- deregistrationDelay String
- healthCheck GetTarget Group Health Check 
- id String
- The provider-assigned unique ID for this managed resource.
- lambdaMulti BooleanValue Headers Enabled 
- loadBalancer List<String>Arns 
- loadBalancing StringAlgorithm Type 
- loadBalancing StringAnomaly Mitigation 
- loadBalancing StringCross Zone Enabled 
- name String
- port Integer
- preserveClient StringIp 
- protocol String
- protocolVersion String
- proxyProtocol BooleanV2 
- slowStart Integer
- stickiness
GetTarget Group Stickiness 
- Map<String,String>
- targetType String
- vpcId String
- arn string
- arnSuffix string
- connectionTermination boolean
- deregistrationDelay string
- healthCheck GetTarget Group Health Check 
- id string
- The provider-assigned unique ID for this managed resource.
- lambdaMulti booleanValue Headers Enabled 
- loadBalancer string[]Arns 
- loadBalancing stringAlgorithm Type 
- loadBalancing stringAnomaly Mitigation 
- loadBalancing stringCross Zone Enabled 
- name string
- port number
- preserveClient stringIp 
- protocol string
- protocolVersion string
- proxyProtocol booleanV2 
- slowStart number
- stickiness
GetTarget Group Stickiness 
- {[key: string]: string}
- targetType string
- vpcId string
- arn str
- arn_suffix str
- connection_termination bool
- deregistration_delay str
- health_check GetTarget Group Health Check 
- id str
- The provider-assigned unique ID for this managed resource.
- lambda_multi_ boolvalue_ headers_ enabled 
- load_balancer_ Sequence[str]arns 
- load_balancing_ stralgorithm_ type 
- load_balancing_ stranomaly_ mitigation 
- load_balancing_ strcross_ zone_ enabled 
- name str
- port int
- preserve_client_ strip 
- protocol str
- protocol_version str
- proxy_protocol_ boolv2 
- slow_start int
- stickiness
GetTarget Group Stickiness 
- Mapping[str, str]
- target_type str
- vpc_id str
- arn String
- arnSuffix String
- connectionTermination Boolean
- deregistrationDelay String
- healthCheck Property Map
- id String
- The provider-assigned unique ID for this managed resource.
- lambdaMulti BooleanValue Headers Enabled 
- loadBalancer List<String>Arns 
- loadBalancing StringAlgorithm Type 
- loadBalancing StringAnomaly Mitigation 
- loadBalancing StringCross Zone Enabled 
- name String
- port Number
- preserveClient StringIp 
- protocol String
- protocolVersion String
- proxyProtocol BooleanV2 
- slowStart Number
- stickiness Property Map
- Map<String>
- targetType String
- vpcId String
Supporting Types
GetTargetGroupHealthCheck    
- 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 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 bool
- healthy_threshold int
- interval int
- matcher str
- path str
- port str
- protocol str
- timeout int
- unhealthy_threshold int
- enabled Boolean
- healthyThreshold Number
- interval Number
- matcher String
- path String
- port String
- protocol String
- timeout Number
- unhealthyThreshold Number
GetTargetGroupStickiness   
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the awsTerraform Provider.