1. Packages
  2. AWS
  3. API Docs
  4. lb
  5. TargetGroupAttachment
AWS v6.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

aws.lb.TargetGroupAttachment

Explore with Pulumi AI

Provides the ability to register instances and containers with an Application Load Balancer (ALB) or Network Load Balancer (NLB) target group. For attaching resources with Elastic Load Balancer (ELB), see the aws.elb.Attachment resource.

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

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const testTargetGroup = new aws.lb.TargetGroup("test", {});
const testInstance = new aws.ec2.Instance("test", {});
const test = new aws.lb.TargetGroupAttachment("test", {
    targetGroupArn: testTargetGroup.arn,
    targetId: testInstance.id,
    port: 80,
});
Copy
import pulumi
import pulumi_aws as aws

test_target_group = aws.lb.TargetGroup("test")
test_instance = aws.ec2.Instance("test")
test = aws.lb.TargetGroupAttachment("test",
    target_group_arn=test_target_group.arn,
    target_id=test_instance.id,
    port=80)
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lb"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		testTargetGroup, err := lb.NewTargetGroup(ctx, "test", nil)
		if err != nil {
			return err
		}
		testInstance, err := ec2.NewInstance(ctx, "test", nil)
		if err != nil {
			return err
		}
		_, err = lb.NewTargetGroupAttachment(ctx, "test", &lb.TargetGroupAttachmentArgs{
			TargetGroupArn: testTargetGroup.Arn,
			TargetId:       testInstance.ID(),
			Port:           pulumi.Int(80),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var testTargetGroup = new Aws.LB.TargetGroup("test");

    var testInstance = new Aws.Ec2.Instance("test");

    var test = new Aws.LB.TargetGroupAttachment("test", new()
    {
        TargetGroupArn = testTargetGroup.Arn,
        TargetId = testInstance.Id,
        Port = 80,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.lb.TargetGroup;
import com.pulumi.aws.ec2.Instance;
import com.pulumi.aws.lb.TargetGroupAttachment;
import com.pulumi.aws.lb.TargetGroupAttachmentArgs;
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) {
        var testTargetGroup = new TargetGroup("testTargetGroup");

        var testInstance = new Instance("testInstance");

        var test = new TargetGroupAttachment("test", TargetGroupAttachmentArgs.builder()
            .targetGroupArn(testTargetGroup.arn())
            .targetId(testInstance.id())
            .port(80)
            .build());

    }
}
Copy
resources:
  test:
    type: aws:lb:TargetGroupAttachment
    properties:
      targetGroupArn: ${testTargetGroup.arn}
      targetId: ${testInstance.id}
      port: 80
  testTargetGroup:
    type: aws:lb:TargetGroup
    name: test
  testInstance:
    type: aws:ec2:Instance
    name: test
Copy

Lambda Target

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const test = new aws.lb.TargetGroup("test", {
    name: "test",
    targetType: "lambda",
});
const testFunction = new aws.lambda.Function("test", {});
const withLb = new aws.lambda.Permission("with_lb", {
    statementId: "AllowExecutionFromlb",
    action: "lambda:InvokeFunction",
    "function": testFunction.name,
    principal: "elasticloadbalancing.amazonaws.com",
    sourceArn: test.arn,
});
const testTargetGroupAttachment = new aws.lb.TargetGroupAttachment("test", {
    targetGroupArn: test.arn,
    targetId: testFunction.arn,
}, {
    dependsOn: [withLb],
});
Copy
import pulumi
import pulumi_aws as aws

test = aws.lb.TargetGroup("test",
    name="test",
    target_type="lambda")
test_function = aws.lambda_.Function("test")
with_lb = aws.lambda_.Permission("with_lb",
    statement_id="AllowExecutionFromlb",
    action="lambda:InvokeFunction",
    function=test_function.name,
    principal="elasticloadbalancing.amazonaws.com",
    source_arn=test.arn)
test_target_group_attachment = aws.lb.TargetGroupAttachment("test",
    target_group_arn=test.arn,
    target_id=test_function.arn,
    opts = pulumi.ResourceOptions(depends_on=[with_lb]))
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lambda"
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lb"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		test, err := lb.NewTargetGroup(ctx, "test", &lb.TargetGroupArgs{
			Name:       pulumi.String("test"),
			TargetType: pulumi.String("lambda"),
		})
		if err != nil {
			return err
		}
		testFunction, err := lambda.NewFunction(ctx, "test", nil)
		if err != nil {
			return err
		}
		withLb, err := lambda.NewPermission(ctx, "with_lb", &lambda.PermissionArgs{
			StatementId: pulumi.String("AllowExecutionFromlb"),
			Action:      pulumi.String("lambda:InvokeFunction"),
			Function:    testFunction.Name,
			Principal:   pulumi.String("elasticloadbalancing.amazonaws.com"),
			SourceArn:   test.Arn,
		})
		if err != nil {
			return err
		}
		_, err = lb.NewTargetGroupAttachment(ctx, "test", &lb.TargetGroupAttachmentArgs{
			TargetGroupArn: test.Arn,
			TargetId:       testFunction.Arn,
		}, pulumi.DependsOn([]pulumi.Resource{
			withLb,
		}))
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var test = new Aws.LB.TargetGroup("test", new()
    {
        Name = "test",
        TargetType = "lambda",
    });

    var testFunction = new Aws.Lambda.Function("test");

    var withLb = new Aws.Lambda.Permission("with_lb", new()
    {
        StatementId = "AllowExecutionFromlb",
        Action = "lambda:InvokeFunction",
        Function = testFunction.Name,
        Principal = "elasticloadbalancing.amazonaws.com",
        SourceArn = test.Arn,
    });

    var testTargetGroupAttachment = new Aws.LB.TargetGroupAttachment("test", new()
    {
        TargetGroupArn = test.Arn,
        TargetId = testFunction.Arn,
    }, new CustomResourceOptions
    {
        DependsOn =
        {
            withLb,
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.lb.TargetGroup;
import com.pulumi.aws.lb.TargetGroupArgs;
import com.pulumi.aws.lambda.Function;
import com.pulumi.aws.lambda.Permission;
import com.pulumi.aws.lambda.PermissionArgs;
import com.pulumi.aws.lb.TargetGroupAttachment;
import com.pulumi.aws.lb.TargetGroupAttachmentArgs;
import com.pulumi.resources.CustomResourceOptions;
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) {
        var test = new TargetGroup("test", TargetGroupArgs.builder()
            .name("test")
            .targetType("lambda")
            .build());

        var testFunction = new Function("testFunction");

        var withLb = new Permission("withLb", PermissionArgs.builder()
            .statementId("AllowExecutionFromlb")
            .action("lambda:InvokeFunction")
            .function(testFunction.name())
            .principal("elasticloadbalancing.amazonaws.com")
            .sourceArn(test.arn())
            .build());

        var testTargetGroupAttachment = new TargetGroupAttachment("testTargetGroupAttachment", TargetGroupAttachmentArgs.builder()
            .targetGroupArn(test.arn())
            .targetId(testFunction.arn())
            .build(), CustomResourceOptions.builder()
                .dependsOn(withLb)
                .build());

    }
}
Copy
resources:
  withLb:
    type: aws:lambda:Permission
    name: with_lb
    properties:
      statementId: AllowExecutionFromlb
      action: lambda:InvokeFunction
      function: ${testFunction.name}
      principal: elasticloadbalancing.amazonaws.com
      sourceArn: ${test.arn}
  test:
    type: aws:lb:TargetGroup
    properties:
      name: test
      targetType: lambda
  testFunction:
    type: aws:lambda:Function
    name: test
  testTargetGroupAttachment:
    type: aws:lb:TargetGroupAttachment
    name: test
    properties:
      targetGroupArn: ${test.arn}
      targetId: ${testFunction.arn}
    options:
      dependsOn:
        - ${withLb}
Copy

Registering Multiple Targets

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example: aws.ec2.Instance[] = [];
for (const range = {value: 0}; range.value < 3; range.value++) {
    example.push(new aws.ec2.Instance(`example-${range.value}`, {}));
}
const exampleTargetGroup = new aws.lb.TargetGroup("example", {});
const exampleTargetGroupAttachment: aws.lb.TargetGroupAttachment[] = [];
pulumi.all(example.map((v, k) => [k, v]).reduce((__obj, [k, v]) => ({ ...__obj, [k]: v }))).apply(rangeBody => {
    for (const range of Object.entries(rangeBody).map(([k, v]) => ({key: k, value: v}))) {
        exampleTargetGroupAttachment.push(new aws.lb.TargetGroupAttachment(`example-${range.key}`, {
            targetGroupArn: exampleTargetGroup.arn,
            targetId: range.value.id,
            port: 80,
        }));
    }
});
Copy
import pulumi
import pulumi_aws as aws

example = []
for range in [{"value": i} for i in range(0, 3)]:
    example.append(aws.ec2.Instance(f"example-{range['value']}"))
example_target_group = aws.lb.TargetGroup("example")
example_target_group_attachment = []
def create_example(range_body):
    for range in [{"key": k, "value": v} for [k, v] in enumerate(range_body)]:
        example_target_group_attachment.append(aws.lb.TargetGroupAttachment(f"example-{range['key']}",
            target_group_arn=example_target_group.arn,
            target_id=range["value"],
            port=80))

pulumi.Output.all({k: v for k, v in example}).apply(lambda resolved_outputs: create_example(resolved_outputs[0]))
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lb"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
var example []*ec2.Instance
for index := 0; index < 3; index++ {
    key0 := index
    _ := index
__res, err := ec2.NewInstance(ctx, fmt.Sprintf("example-%v", key0), nil)
if err != nil {
return err
}
example = append(example, __res)
}
exampleTargetGroup, err := lb.NewTargetGroup(ctx, "example", nil)
if err != nil {
return err
}
var exampleTargetGroupAttachment []*lb.TargetGroupAttachment
for key0, val0 := range %!v(PANIC=Format method: fatal: An assertion has failed: tok: ) {
__res, err := lb.NewTargetGroupAttachment(ctx, fmt.Sprintf("example-%v", key0), &lb.TargetGroupAttachmentArgs{
TargetGroupArn: exampleTargetGroup.Arn,
TargetId: pulumi.String(val0),
Port: pulumi.Int(80),
})
if err != nil {
return err
}
exampleTargetGroupAttachment = append(exampleTargetGroupAttachment, __res)
}
return nil
})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new List<Aws.Ec2.Instance>();
    for (var rangeIndex = 0; rangeIndex < 3; rangeIndex++)
    {
        var range = new { Value = rangeIndex };
        example.Add(new Aws.Ec2.Instance($"example-{range.Value}", new()
        {
        }));
    }
    var exampleTargetGroup = new Aws.LB.TargetGroup("example");

    var exampleTargetGroupAttachment = new List<Aws.LB.TargetGroupAttachment>();
    foreach (var range in example.Select((value, i) => new { Key = i.ToString(), Value = pair.Value }).Select(pair => new { pair.Key, pair.Value }))
    {
        exampleTargetGroupAttachment.Add(new Aws.LB.TargetGroupAttachment($"example-{range.Key}", new()
        {
            TargetGroupArn = exampleTargetGroup.Arn,
            TargetId = range.Value.Id,
            Port = 80,
        }));
    }
});
Copy
Coming soon!
resources:
  example:
    type: aws:ec2:Instance
    options: {}
  exampleTargetGroup:
    type: aws:lb:TargetGroup
    name: example
  exampleTargetGroupAttachment:
    type: aws:lb:TargetGroupAttachment
    name: example
    properties:
      targetGroupArn: ${exampleTargetGroup.arn}
      targetId: ${range.value.id}
      port: 80
    options: {}
Copy

Create TargetGroupAttachment Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new TargetGroupAttachment(name: string, args: TargetGroupAttachmentArgs, opts?: CustomResourceOptions);
@overload
def TargetGroupAttachment(resource_name: str,
                          args: TargetGroupAttachmentArgs,
                          opts: Optional[ResourceOptions] = None)

@overload
def TargetGroupAttachment(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          target_group_arn: Optional[str] = None,
                          target_id: Optional[str] = None,
                          availability_zone: Optional[str] = None,
                          port: Optional[int] = None)
func NewTargetGroupAttachment(ctx *Context, name string, args TargetGroupAttachmentArgs, opts ...ResourceOption) (*TargetGroupAttachment, error)
public TargetGroupAttachment(string name, TargetGroupAttachmentArgs args, CustomResourceOptions? opts = null)
public TargetGroupAttachment(String name, TargetGroupAttachmentArgs args)
public TargetGroupAttachment(String name, TargetGroupAttachmentArgs args, CustomResourceOptions options)
type: aws:lb:TargetGroupAttachment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. TargetGroupAttachmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. TargetGroupAttachmentArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. TargetGroupAttachmentArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. TargetGroupAttachmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. TargetGroupAttachmentArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var awsTargetGroupAttachmentResource = new Aws.LB.TargetGroupAttachment("awsTargetGroupAttachmentResource", new()
{
    TargetGroupArn = "string",
    TargetId = "string",
    AvailabilityZone = "string",
    Port = 0,
});
Copy
example, err := lb.NewTargetGroupAttachment(ctx, "awsTargetGroupAttachmentResource", &lb.TargetGroupAttachmentArgs{
	TargetGroupArn:   pulumi.String("string"),
	TargetId:         pulumi.String("string"),
	AvailabilityZone: pulumi.String("string"),
	Port:             pulumi.Int(0),
})
Copy
var awsTargetGroupAttachmentResource = new TargetGroupAttachment("awsTargetGroupAttachmentResource", TargetGroupAttachmentArgs.builder()
    .targetGroupArn("string")
    .targetId("string")
    .availabilityZone("string")
    .port(0)
    .build());
Copy
aws_target_group_attachment_resource = aws.lb.TargetGroupAttachment("awsTargetGroupAttachmentResource",
    target_group_arn="string",
    target_id="string",
    availability_zone="string",
    port=0)
Copy
const awsTargetGroupAttachmentResource = new aws.lb.TargetGroupAttachment("awsTargetGroupAttachmentResource", {
    targetGroupArn: "string",
    targetId: "string",
    availabilityZone: "string",
    port: 0,
});
Copy
type: aws:lb:TargetGroupAttachment
properties:
    availabilityZone: string
    port: 0
    targetGroupArn: string
    targetId: string
Copy

TargetGroupAttachment Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The TargetGroupAttachment resource accepts the following input properties:

TargetGroupArn
This property is required.
Changes to this property will trigger replacement.
string
The ARN of the target group with which to register targets.
TargetId
This property is required.
Changes to this property will trigger replacement.
string

The ID of the target. This is the Instance ID for an instance, or the container ID for an ECS container. If the target type is ip, specify an IP address. If the target type is lambda, specify the Lambda function ARN. If the target type is alb, specify the ALB ARN.

The following arguments are optional:

AvailabilityZone Changes to this property will trigger replacement. string
The Availability Zone where the IP address of the target is to be registered. If the private IP address is outside of the VPC scope, this value must be set to all.
Port Changes to this property will trigger replacement. int
The port on which targets receive traffic.
TargetGroupArn
This property is required.
Changes to this property will trigger replacement.
string
The ARN of the target group with which to register targets.
TargetId
This property is required.
Changes to this property will trigger replacement.
string

The ID of the target. This is the Instance ID for an instance, or the container ID for an ECS container. If the target type is ip, specify an IP address. If the target type is lambda, specify the Lambda function ARN. If the target type is alb, specify the ALB ARN.

The following arguments are optional:

AvailabilityZone Changes to this property will trigger replacement. string
The Availability Zone where the IP address of the target is to be registered. If the private IP address is outside of the VPC scope, this value must be set to all.
Port Changes to this property will trigger replacement. int
The port on which targets receive traffic.
targetGroupArn
This property is required.
Changes to this property will trigger replacement.
String
The ARN of the target group with which to register targets.
targetId
This property is required.
Changes to this property will trigger replacement.
String

The ID of the target. This is the Instance ID for an instance, or the container ID for an ECS container. If the target type is ip, specify an IP address. If the target type is lambda, specify the Lambda function ARN. If the target type is alb, specify the ALB ARN.

The following arguments are optional:

availabilityZone Changes to this property will trigger replacement. String
The Availability Zone where the IP address of the target is to be registered. If the private IP address is outside of the VPC scope, this value must be set to all.
port Changes to this property will trigger replacement. Integer
The port on which targets receive traffic.
targetGroupArn
This property is required.
Changes to this property will trigger replacement.
string
The ARN of the target group with which to register targets.
targetId
This property is required.
Changes to this property will trigger replacement.
string

The ID of the target. This is the Instance ID for an instance, or the container ID for an ECS container. If the target type is ip, specify an IP address. If the target type is lambda, specify the Lambda function ARN. If the target type is alb, specify the ALB ARN.

The following arguments are optional:

availabilityZone Changes to this property will trigger replacement. string
The Availability Zone where the IP address of the target is to be registered. If the private IP address is outside of the VPC scope, this value must be set to all.
port Changes to this property will trigger replacement. number
The port on which targets receive traffic.
target_group_arn
This property is required.
Changes to this property will trigger replacement.
str
The ARN of the target group with which to register targets.
target_id
This property is required.
Changes to this property will trigger replacement.
str

The ID of the target. This is the Instance ID for an instance, or the container ID for an ECS container. If the target type is ip, specify an IP address. If the target type is lambda, specify the Lambda function ARN. If the target type is alb, specify the ALB ARN.

The following arguments are optional:

availability_zone Changes to this property will trigger replacement. str
The Availability Zone where the IP address of the target is to be registered. If the private IP address is outside of the VPC scope, this value must be set to all.
port Changes to this property will trigger replacement. int
The port on which targets receive traffic.
targetGroupArn
This property is required.
Changes to this property will trigger replacement.
String
The ARN of the target group with which to register targets.
targetId
This property is required.
Changes to this property will trigger replacement.
String

The ID of the target. This is the Instance ID for an instance, or the container ID for an ECS container. If the target type is ip, specify an IP address. If the target type is lambda, specify the Lambda function ARN. If the target type is alb, specify the ALB ARN.

The following arguments are optional:

availabilityZone Changes to this property will trigger replacement. String
The Availability Zone where the IP address of the target is to be registered. If the private IP address is outside of the VPC scope, this value must be set to all.
port Changes to this property will trigger replacement. Number
The port on which targets receive traffic.

Outputs

All input properties are implicitly available as output properties. Additionally, the TargetGroupAttachment resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing TargetGroupAttachment Resource

Get an existing TargetGroupAttachment resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: TargetGroupAttachmentState, opts?: CustomResourceOptions): TargetGroupAttachment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        availability_zone: Optional[str] = None,
        port: Optional[int] = None,
        target_group_arn: Optional[str] = None,
        target_id: Optional[str] = None) -> TargetGroupAttachment
func GetTargetGroupAttachment(ctx *Context, name string, id IDInput, state *TargetGroupAttachmentState, opts ...ResourceOption) (*TargetGroupAttachment, error)
public static TargetGroupAttachment Get(string name, Input<string> id, TargetGroupAttachmentState? state, CustomResourceOptions? opts = null)
public static TargetGroupAttachment get(String name, Output<String> id, TargetGroupAttachmentState state, CustomResourceOptions options)
resources:  _:    type: aws:lb:TargetGroupAttachment    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AvailabilityZone Changes to this property will trigger replacement. string
The Availability Zone where the IP address of the target is to be registered. If the private IP address is outside of the VPC scope, this value must be set to all.
Port Changes to this property will trigger replacement. int
The port on which targets receive traffic.
TargetGroupArn Changes to this property will trigger replacement. string
The ARN of the target group with which to register targets.
TargetId Changes to this property will trigger replacement. string

The ID of the target. This is the Instance ID for an instance, or the container ID for an ECS container. If the target type is ip, specify an IP address. If the target type is lambda, specify the Lambda function ARN. If the target type is alb, specify the ALB ARN.

The following arguments are optional:

AvailabilityZone Changes to this property will trigger replacement. string
The Availability Zone where the IP address of the target is to be registered. If the private IP address is outside of the VPC scope, this value must be set to all.
Port Changes to this property will trigger replacement. int
The port on which targets receive traffic.
TargetGroupArn Changes to this property will trigger replacement. string
The ARN of the target group with which to register targets.
TargetId Changes to this property will trigger replacement. string

The ID of the target. This is the Instance ID for an instance, or the container ID for an ECS container. If the target type is ip, specify an IP address. If the target type is lambda, specify the Lambda function ARN. If the target type is alb, specify the ALB ARN.

The following arguments are optional:

availabilityZone Changes to this property will trigger replacement. String
The Availability Zone where the IP address of the target is to be registered. If the private IP address is outside of the VPC scope, this value must be set to all.
port Changes to this property will trigger replacement. Integer
The port on which targets receive traffic.
targetGroupArn Changes to this property will trigger replacement. String
The ARN of the target group with which to register targets.
targetId Changes to this property will trigger replacement. String

The ID of the target. This is the Instance ID for an instance, or the container ID for an ECS container. If the target type is ip, specify an IP address. If the target type is lambda, specify the Lambda function ARN. If the target type is alb, specify the ALB ARN.

The following arguments are optional:

availabilityZone Changes to this property will trigger replacement. string
The Availability Zone where the IP address of the target is to be registered. If the private IP address is outside of the VPC scope, this value must be set to all.
port Changes to this property will trigger replacement. number
The port on which targets receive traffic.
targetGroupArn Changes to this property will trigger replacement. string
The ARN of the target group with which to register targets.
targetId Changes to this property will trigger replacement. string

The ID of the target. This is the Instance ID for an instance, or the container ID for an ECS container. If the target type is ip, specify an IP address. If the target type is lambda, specify the Lambda function ARN. If the target type is alb, specify the ALB ARN.

The following arguments are optional:

availability_zone Changes to this property will trigger replacement. str
The Availability Zone where the IP address of the target is to be registered. If the private IP address is outside of the VPC scope, this value must be set to all.
port Changes to this property will trigger replacement. int
The port on which targets receive traffic.
target_group_arn Changes to this property will trigger replacement. str
The ARN of the target group with which to register targets.
target_id Changes to this property will trigger replacement. str

The ID of the target. This is the Instance ID for an instance, or the container ID for an ECS container. If the target type is ip, specify an IP address. If the target type is lambda, specify the Lambda function ARN. If the target type is alb, specify the ALB ARN.

The following arguments are optional:

availabilityZone Changes to this property will trigger replacement. String
The Availability Zone where the IP address of the target is to be registered. If the private IP address is outside of the VPC scope, this value must be set to all.
port Changes to this property will trigger replacement. Number
The port on which targets receive traffic.
targetGroupArn Changes to this property will trigger replacement. String
The ARN of the target group with which to register targets.
targetId Changes to this property will trigger replacement. String

The ID of the target. This is the Instance ID for an instance, or the container ID for an ECS container. If the target type is ip, specify an IP address. If the target type is lambda, specify the Lambda function ARN. If the target type is alb, specify the ALB ARN.

The following arguments are optional:

Import

You cannot import Target Group Attachments.

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.