aws.alb.getTargetGroup
Explore with Pulumi AI
Note:
aws.alb.TargetGroup
is 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)
// Output-based functions aren't available in Java yet
fn::invoke:
function: aws:alb/getTargetGroup:getTargetGroup
arguments:
# arguments dictionary
The following arguments are supported:
- Arn string
- Full ARN of the target group.
- Load
Balancing 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
arn
andname
are specified,arn
takes precedence.tags
has the lowest precedence.
- Arn string
- Full ARN of the target group.
- Load
Balancing 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
arn
andname
are specified,arn
takes precedence.tags
has the lowest precedence.
- arn String
- Full ARN of the target group.
- load
Balancing 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
arn
andname
are specified,arn
takes precedence.tags
has the lowest precedence.
- arn string
- Full ARN of the target group.
- load
Balancing 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
arn
andname
are specified,arn
takes precedence.tags
has 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
arn
andname
are specified,arn
takes precedence.tags
has the lowest precedence.
- arn String
- Full ARN of the target group.
- load
Balancing 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
arn
andname
are specified,arn
takes precedence.tags
has the lowest precedence.
getTargetGroup Result
The following output properties are available:
- Arn string
- Arn
Suffix string - Connection
Termination bool - Deregistration
Delay string - Health
Check GetTarget Group Health Check - Id string
- The provider-assigned unique ID for this managed resource.
- Lambda
Multi boolValue Headers Enabled - Load
Balancer List<string>Arns - Load
Balancing stringAlgorithm Type - Load
Balancing stringAnomaly Mitigation - Load
Balancing stringCross Zone Enabled - Name string
- Port int
- Preserve
Client stringIp - Protocol string
- Protocol
Version string - Proxy
Protocol boolV2 - Slow
Start int - Stickiness
Get
Target Group Stickiness - Dictionary<string, string>
- Target
Type string - Vpc
Id string
- Arn string
- Arn
Suffix string - Connection
Termination bool - Deregistration
Delay string - Health
Check GetTarget Group Health Check - Id string
- The provider-assigned unique ID for this managed resource.
- Lambda
Multi boolValue Headers Enabled - Load
Balancer []stringArns - Load
Balancing stringAlgorithm Type - Load
Balancing stringAnomaly Mitigation - Load
Balancing stringCross Zone Enabled - Name string
- Port int
- Preserve
Client stringIp - Protocol string
- Protocol
Version string - Proxy
Protocol boolV2 - Slow
Start int - Stickiness
Get
Target Group Stickiness - map[string]string
- Target
Type string - Vpc
Id string
- arn String
- arn
Suffix String - connection
Termination Boolean - deregistration
Delay String - health
Check GetTarget Group Health Check - id String
- The provider-assigned unique ID for this managed resource.
- lambda
Multi BooleanValue Headers Enabled - load
Balancer List<String>Arns - load
Balancing StringAlgorithm Type - load
Balancing StringAnomaly Mitigation - load
Balancing StringCross Zone Enabled - name String
- port Integer
- preserve
Client StringIp - protocol String
- protocol
Version String - proxy
Protocol BooleanV2 - slow
Start Integer - stickiness
Get
Target Group Stickiness - Map<String,String>
- target
Type String - vpc
Id String
- arn string
- arn
Suffix string - connection
Termination boolean - deregistration
Delay string - health
Check GetTarget Group Health Check - id string
- The provider-assigned unique ID for this managed resource.
- lambda
Multi booleanValue Headers Enabled - load
Balancer string[]Arns - load
Balancing stringAlgorithm Type - load
Balancing stringAnomaly Mitigation - load
Balancing stringCross Zone Enabled - name string
- port number
- preserve
Client stringIp - protocol string
- protocol
Version string - proxy
Protocol booleanV2 - slow
Start number - stickiness
Get
Target Group Stickiness - {[key: string]: string}
- target
Type string - vpc
Id 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
Get
Target Group Stickiness - Mapping[str, str]
- target_
type str - vpc_
id str
- arn String
- arn
Suffix String - connection
Termination Boolean - deregistration
Delay String - health
Check Property Map - id String
- The provider-assigned unique ID for this managed resource.
- lambda
Multi BooleanValue Headers Enabled - load
Balancer List<String>Arns - load
Balancing StringAlgorithm Type - load
Balancing StringAnomaly Mitigation - load
Balancing StringCross Zone Enabled - name String
- port Number
- preserve
Client StringIp - protocol String
- protocol
Version String - proxy
Protocol BooleanV2 - slow
Start Number - stickiness Property Map
- Map<String>
- target
Type String - vpc
Id String
Supporting Types
GetTargetGroupHealthCheck
- Enabled bool
- Healthy
Threshold int - Interval int
- Matcher string
- Path string
- Port string
- Protocol string
- Timeout int
- Unhealthy
Threshold int
- Enabled bool
- Healthy
Threshold int - Interval int
- Matcher string
- Path string
- Port string
- Protocol string
- Timeout int
- Unhealthy
Threshold int
- enabled Boolean
- healthy
Threshold Integer - interval Integer
- matcher String
- path String
- port String
- protocol String
- timeout Integer
- unhealthy
Threshold Integer
- enabled boolean
- healthy
Threshold number - interval number
- matcher string
- path string
- port string
- protocol string
- timeout number
- unhealthy
Threshold number
- enabled bool
- healthy_
threshold int - interval int
- matcher str
- path str
- port str
- protocol str
- timeout int
- unhealthy_
threshold int
- enabled Boolean
- healthy
Threshold Number - interval Number
- matcher String
- path String
- port String
- protocol String
- timeout Number
- unhealthy
Threshold Number
GetTargetGroupStickiness
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.