1. Packages
  2. AWS Classic
  3. API Docs
  4. alb
  5. TargetGroupAttachment

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

AWS Classic v6.23.0 published on Thursday, Feb 22, 2024 by Pulumi

aws.alb.TargetGroupAttachment

Explore with Pulumi AI

aws logo

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

AWS Classic v6.23.0 published on Thursday, Feb 22, 2024 by Pulumi

    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

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var testTargetGroup = new Aws.LB.TargetGroup("testTargetGroup");
    
        // ... other configuration ...
        var testInstance = new Aws.Ec2.Instance("testInstance");
    
        // ... other configuration ...
        var testTargetGroupAttachment = new Aws.LB.TargetGroupAttachment("testTargetGroupAttachment", new()
        {
            TargetGroupArn = testTargetGroup.Arn,
            TargetId = testInstance.Id,
            Port = 80,
        });
    
    });
    
    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, "testTargetGroup", nil)
    		if err != nil {
    			return err
    		}
    		testInstance, err := ec2.NewInstance(ctx, "testInstance", nil)
    		if err != nil {
    			return err
    		}
    		_, err = lb.NewTargetGroupAttachment(ctx, "testTargetGroupAttachment", &lb.TargetGroupAttachmentArgs{
    			TargetGroupArn: testTargetGroup.Arn,
    			TargetId:       testInstance.ID(),
    			Port:           pulumi.Int(80),
    		})
    		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.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 testTargetGroupAttachment = new TargetGroupAttachment("testTargetGroupAttachment", TargetGroupAttachmentArgs.builder()        
                .targetGroupArn(testTargetGroup.arn())
                .targetId(testInstance.id())
                .port(80)
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    test_target_group = aws.lb.TargetGroup("testTargetGroup")
    # ... other configuration ...
    test_instance = aws.ec2.Instance("testInstance")
    # ... other configuration ...
    test_target_group_attachment = aws.lb.TargetGroupAttachment("testTargetGroupAttachment",
        target_group_arn=test_target_group.arn,
        target_id=test_instance.id,
        port=80)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const testTargetGroup = new aws.lb.TargetGroup("testTargetGroup", {});
    // ... other configuration ...
    const testInstance = new aws.ec2.Instance("testInstance", {});
    // ... other configuration ...
    const testTargetGroupAttachment = new aws.lb.TargetGroupAttachment("testTargetGroupAttachment", {
        targetGroupArn: testTargetGroup.arn,
        targetId: testInstance.id,
        port: 80,
    });
    
    resources:
      testTargetGroupAttachment:
        type: aws:lb:TargetGroupAttachment
        properties:
          targetGroupArn: ${testTargetGroup.arn}
          targetId: ${testInstance.id}
          port: 80
      testTargetGroup:
        type: aws:lb:TargetGroup
      testInstance:
        type: aws:ec2:Instance
    

    Lambda Target

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var testTargetGroup = new Aws.LB.TargetGroup("testTargetGroup", new()
        {
            TargetType = "lambda",
        });
    
        var testFunction = new Aws.Lambda.Function("testFunction");
    
        // ... other configuration ...
        var withLb = new Aws.Lambda.Permission("withLb", new()
        {
            Action = "lambda:InvokeFunction",
            Function = testFunction.Name,
            Principal = "elasticloadbalancing.amazonaws.com",
            SourceArn = testTargetGroup.Arn,
        });
    
        var testTargetGroupAttachment = new Aws.LB.TargetGroupAttachment("testTargetGroupAttachment", new()
        {
            TargetGroupArn = testTargetGroup.Arn,
            TargetId = testFunction.Arn,
        }, new CustomResourceOptions
        {
            DependsOn = new[]
            {
                withLb,
            },
        });
    
    });
    
    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 {
    		testTargetGroup, err := lb.NewTargetGroup(ctx, "testTargetGroup", &lb.TargetGroupArgs{
    			TargetType: pulumi.String("lambda"),
    		})
    		if err != nil {
    			return err
    		}
    		testFunction, err := lambda.NewFunction(ctx, "testFunction", nil)
    		if err != nil {
    			return err
    		}
    		withLb, err := lambda.NewPermission(ctx, "withLb", &lambda.PermissionArgs{
    			Action:    pulumi.String("lambda:InvokeFunction"),
    			Function:  testFunction.Name,
    			Principal: pulumi.String("elasticloadbalancing.amazonaws.com"),
    			SourceArn: testTargetGroup.Arn,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = lb.NewTargetGroupAttachment(ctx, "testTargetGroupAttachment", &lb.TargetGroupAttachmentArgs{
    			TargetGroupArn: testTargetGroup.Arn,
    			TargetId:       testFunction.Arn,
    		}, pulumi.DependsOn([]pulumi.Resource{
    			withLb,
    		}))
    		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.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 testTargetGroup = new TargetGroup("testTargetGroup", TargetGroupArgs.builder()        
                .targetType("lambda")
                .build());
    
            var testFunction = new Function("testFunction");
    
            var withLb = new Permission("withLb", PermissionArgs.builder()        
                .action("lambda:InvokeFunction")
                .function(testFunction.name())
                .principal("elasticloadbalancing.amazonaws.com")
                .sourceArn(testTargetGroup.arn())
                .build());
    
            var testTargetGroupAttachment = new TargetGroupAttachment("testTargetGroupAttachment", TargetGroupAttachmentArgs.builder()        
                .targetGroupArn(testTargetGroup.arn())
                .targetId(testFunction.arn())
                .build(), CustomResourceOptions.builder()
                    .dependsOn(withLb)
                    .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    test_target_group = aws.lb.TargetGroup("testTargetGroup", target_type="lambda")
    test_function = aws.lambda_.Function("testFunction")
    # ... other configuration ...
    with_lb = aws.lambda_.Permission("withLb",
        action="lambda:InvokeFunction",
        function=test_function.name,
        principal="elasticloadbalancing.amazonaws.com",
        source_arn=test_target_group.arn)
    test_target_group_attachment = aws.lb.TargetGroupAttachment("testTargetGroupAttachment",
        target_group_arn=test_target_group.arn,
        target_id=test_function.arn,
        opts=pulumi.ResourceOptions(depends_on=[with_lb]))
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const testTargetGroup = new aws.lb.TargetGroup("testTargetGroup", {targetType: "lambda"});
    const testFunction = new aws.lambda.Function("testFunction", {});
    // ... other configuration ...
    const withLb = new aws.lambda.Permission("withLb", {
        action: "lambda:InvokeFunction",
        "function": testFunction.name,
        principal: "elasticloadbalancing.amazonaws.com",
        sourceArn: testTargetGroup.arn,
    });
    const testTargetGroupAttachment = new aws.lb.TargetGroupAttachment("testTargetGroupAttachment", {
        targetGroupArn: testTargetGroup.arn,
        targetId: testFunction.arn,
    }, {
        dependsOn: [withLb],
    });
    
    resources:
      withLb:
        type: aws:lambda:Permission
        properties:
          action: lambda:InvokeFunction
          function: ${testFunction.name}
          principal: elasticloadbalancing.amazonaws.com
          sourceArn: ${testTargetGroup.arn}
      testTargetGroup:
        type: aws:lb:TargetGroup
        properties:
          targetType: lambda
      testFunction:
        type: aws:lambda:Function
      testTargetGroupAttachment:
        type: aws:lb:TargetGroupAttachment
        properties:
          targetGroupArn: ${testTargetGroup.arn}
          targetId: ${testFunction.arn}
        options:
          dependson:
            - ${withLb}
    

    Registering Multiple Targets

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleInstance = new List<Aws.Ec2.Instance>();
        for (var rangeIndex = 0; rangeIndex < 3; rangeIndex++)
        {
            var range = new { Value = rangeIndex };
            exampleInstance.Add(new Aws.Ec2.Instance($"exampleInstance-{range.Value}", new()
            {
            }));
        }
        // ... other configuration ...
        var exampleTargetGroup = new Aws.LB.TargetGroup("exampleTargetGroup");
    
        // ... other configuration ...
        var exampleTargetGroupAttachment = new List<Aws.LB.TargetGroupAttachment>();
        foreach (var range in exampleInstance.Select((value, i) => new { Key = i.ToString(), Value = pair.Value }).Select(pair => new { pair.Key, pair.Value }))
        {
            exampleTargetGroupAttachment.Add(new Aws.LB.TargetGroupAttachment($"exampleTargetGroupAttachment-{range.Key}", new()
            {
                TargetGroupArn = exampleTargetGroup.Arn,
                TargetId = range.Value.Id,
                Port = 80,
            }));
        }
    });
    
    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 exampleInstance []*ec2.Instance
    		for index := 0; index < 3; index++ {
    			key0 := index
    			_ := index
    			__res, err := ec2.NewInstance(ctx, fmt.Sprintf("exampleInstance-%v", key0), nil)
    			if err != nil {
    				return err
    			}
    			exampleInstance = append(exampleInstance, __res)
    		}
    		exampleTargetGroup, err := lb.NewTargetGroup(ctx, "exampleTargetGroup", nil)
    		if err != nil {
    			return err
    		}
    		var exampleTargetGroupAttachment []*lb.TargetGroupAttachment
    		for key0, val0 := range "TODO: For expression" {
    			__res, err := lb.NewTargetGroupAttachment(ctx, fmt.Sprintf("exampleTargetGroupAttachment-%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
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_aws as aws
    
    example_instance = []
    for range in [{"value": i} for i in range(0, 3)]:
        example_instance.append(aws.ec2.Instance(f"exampleInstance-{range['value']}"))
    # ... other configuration ...
    example_target_group = aws.lb.TargetGroup("exampleTargetGroup")
    # ... other configuration ...
    example_target_group_attachment = []
    def create_example_target_group_attachment(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"exampleTargetGroupAttachment-{range['key']}",
                target_group_arn=example_target_group.arn,
                target_id=range["value"],
                port=80))
    
    pulumi.Output.all({v.id: v for k, v in example_instance}).apply(lambda resolved_outputs: create_example_target_group_attachment(resolved_outputs[0]))
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const exampleInstance: aws.ec2.Instance[] = [];
    for (const range = {value: 0}; range.value < 3; range.value++) {
        exampleInstance.push(new aws.ec2.Instance(`exampleInstance-${range.value}`, {}));
    }
    // ... other configuration ...
    const exampleTargetGroup = new aws.lb.TargetGroup("exampleTargetGroup", {});
    // ... other configuration ...
    const exampleTargetGroupAttachment: aws.lb.TargetGroupAttachment[] = [];
    pulumi.all(exampleInstance.map((v, k) => [k, v]).reduce((__obj, [, ]) => ({ ...__obj, [v.id]: v }))).apply(rangeBody => {
        for (const range of Object.entries(rangeBody).map(([k, v]) => ({key: k, value: v}))) {
            exampleTargetGroupAttachment.push(new aws.lb.TargetGroupAttachment(`exampleTargetGroupAttachment-${range.key}`, {
                targetGroupArn: exampleTargetGroup.arn,
                targetId: range.value.id,
                port: 80,
            }));
        }
    });
    
    resources:
      exampleInstance:
        type: aws:ec2:Instance
        options: {}
      exampleTargetGroup:
        type: aws:lb:TargetGroup
      exampleTargetGroupAttachment:
        type: aws:lb:TargetGroupAttachment
        properties:
          targetGroupArn: ${exampleTargetGroup.arn}
          targetId: ${range.value.id}
          port: 80
        options: {}
    

    Create TargetGroupAttachment Resource

    new TargetGroupAttachment(name: string, args: TargetGroupAttachmentArgs, opts?: CustomResourceOptions);
    @overload
    def TargetGroupAttachment(resource_name: 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)
    @overload
    def TargetGroupAttachment(resource_name: str,
                              args: TargetGroupAttachmentArgs,
                              opts: Optional[ResourceOptions] = 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:alb:TargetGroupAttachment
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args TargetGroupAttachmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args 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 string
    The unique name of the resource.
    args TargetGroupAttachmentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TargetGroupAttachmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TargetGroupAttachmentArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    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

    The TargetGroupAttachment resource accepts the following input properties:

    TargetGroupArn string
    The ARN of the target group with which to register targets.
    TargetId 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 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 int
    The port on which targets receive traffic.
    TargetGroupArn string
    The ARN of the target group with which to register targets.
    TargetId 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 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 int
    The port on which targets receive traffic.
    targetGroupArn String
    The ARN of the target group with which to register targets.
    targetId 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 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 Integer
    The port on which targets receive traffic.
    targetGroupArn string
    The ARN of the target group with which to register targets.
    targetId 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 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 number
    The port on which targets receive traffic.
    target_group_arn str
    The ARN of the target group with which to register targets.
    target_id 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 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 int
    The port on which targets receive traffic.
    targetGroupArn String
    The ARN of the target group with which to register targets.
    targetId 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 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 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)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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 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 int
    The port on which targets receive traffic.
    TargetGroupArn string
    The ARN of the target group with which to register targets.
    TargetId 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 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 int
    The port on which targets receive traffic.
    TargetGroupArn string
    The ARN of the target group with which to register targets.
    TargetId 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 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 Integer
    The port on which targets receive traffic.
    targetGroupArn String
    The ARN of the target group with which to register targets.
    targetId 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 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 number
    The port on which targets receive traffic.
    targetGroupArn string
    The ARN of the target group with which to register targets.
    targetId 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 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 int
    The port on which targets receive traffic.
    target_group_arn str
    The ARN of the target group with which to register targets.
    target_id 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 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 Number
    The port on which targets receive traffic.
    targetGroupArn String
    The ARN of the target group with which to register targets.
    targetId 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.

    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 v6.23.0 published on Thursday, Feb 22, 2024 by Pulumi