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

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

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

aws.vpclattice.TargetGroupAttachment

Explore with Pulumi AI

aws logo

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

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

    Provides the ability to register a target with an AWS VPC Lattice Target Group.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.vpclattice.TargetGroupAttachment("example", {
        targetGroupIdentifier: exampleAwsVpclatticeTargetGroup.id,
        target: {
            id: exampleAwsLb.arn,
            port: 80,
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.vpclattice.TargetGroupAttachment("example",
        target_group_identifier=example_aws_vpclattice_target_group["id"],
        target={
            "id": example_aws_lb["arn"],
            "port": 80,
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/vpclattice"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vpclattice.NewTargetGroupAttachment(ctx, "example", &vpclattice.TargetGroupAttachmentArgs{
    			TargetGroupIdentifier: pulumi.Any(exampleAwsVpclatticeTargetGroup.Id),
    			Target: &vpclattice.TargetGroupAttachmentTargetArgs{
    				Id:   pulumi.Any(exampleAwsLb.Arn),
    				Port: pulumi.Int(80),
    			},
    		})
    		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 example = new Aws.VpcLattice.TargetGroupAttachment("example", new()
        {
            TargetGroupIdentifier = exampleAwsVpclatticeTargetGroup.Id,
            Target = new Aws.VpcLattice.Inputs.TargetGroupAttachmentTargetArgs
            {
                Id = exampleAwsLb.Arn,
                Port = 80,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.vpclattice.TargetGroupAttachment;
    import com.pulumi.aws.vpclattice.TargetGroupAttachmentArgs;
    import com.pulumi.aws.vpclattice.inputs.TargetGroupAttachmentTargetArgs;
    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 example = new TargetGroupAttachment("example", TargetGroupAttachmentArgs.builder()
                .targetGroupIdentifier(exampleAwsVpclatticeTargetGroup.id())
                .target(TargetGroupAttachmentTargetArgs.builder()
                    .id(exampleAwsLb.arn())
                    .port(80)
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:vpclattice:TargetGroupAttachment
        properties:
          targetGroupIdentifier: ${exampleAwsVpclatticeTargetGroup.id}
          target:
            id: ${exampleAwsLb.arn}
            port: 80
    

    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: Optional[TargetGroupAttachmentTargetArgs] = None,
                              target_group_identifier: Optional[str] = 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:vpclattice:TargetGroupAttachment
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    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.

    Constructor example

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

    var exampletargetGroupAttachmentResourceResourceFromVpclatticetargetGroupAttachment = new Aws.VpcLattice.TargetGroupAttachment("exampletargetGroupAttachmentResourceResourceFromVpclatticetargetGroupAttachment", new()
    {
        Target = new Aws.VpcLattice.Inputs.TargetGroupAttachmentTargetArgs
        {
            Id = "string",
            Port = 0,
        },
        TargetGroupIdentifier = "string",
    });
    
    example, err := vpclattice.NewTargetGroupAttachment(ctx, "exampletargetGroupAttachmentResourceResourceFromVpclatticetargetGroupAttachment", &vpclattice.TargetGroupAttachmentArgs{
    	Target: &vpclattice.TargetGroupAttachmentTargetArgs{
    		Id:   pulumi.String("string"),
    		Port: pulumi.Int(0),
    	},
    	TargetGroupIdentifier: pulumi.String("string"),
    })
    
    var exampletargetGroupAttachmentResourceResourceFromVpclatticetargetGroupAttachment = new TargetGroupAttachment("exampletargetGroupAttachmentResourceResourceFromVpclatticetargetGroupAttachment", TargetGroupAttachmentArgs.builder()
        .target(TargetGroupAttachmentTargetArgs.builder()
            .id("string")
            .port(0)
            .build())
        .targetGroupIdentifier("string")
        .build());
    
    exampletarget_group_attachment_resource_resource_from_vpclatticetarget_group_attachment = aws.vpclattice.TargetGroupAttachment("exampletargetGroupAttachmentResourceResourceFromVpclatticetargetGroupAttachment",
        target={
            "id": "string",
            "port": 0,
        },
        target_group_identifier="string")
    
    const exampletargetGroupAttachmentResourceResourceFromVpclatticetargetGroupAttachment = new aws.vpclattice.TargetGroupAttachment("exampletargetGroupAttachmentResourceResourceFromVpclatticetargetGroupAttachment", {
        target: {
            id: "string",
            port: 0,
        },
        targetGroupIdentifier: "string",
    });
    
    type: aws:vpclattice:TargetGroupAttachment
    properties:
        target:
            id: string
            port: 0
        targetGroupIdentifier: string
    

    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:

    Target TargetGroupAttachmentTarget
    The target.
    TargetGroupIdentifier string
    The ID or Amazon Resource Name (ARN) of the target group.
    Target TargetGroupAttachmentTargetArgs
    The target.
    TargetGroupIdentifier string
    The ID or Amazon Resource Name (ARN) of the target group.
    target TargetGroupAttachmentTarget
    The target.
    targetGroupIdentifier String
    The ID or Amazon Resource Name (ARN) of the target group.
    target TargetGroupAttachmentTarget
    The target.
    targetGroupIdentifier string
    The ID or Amazon Resource Name (ARN) of the target group.
    target TargetGroupAttachmentTargetArgs
    The target.
    target_group_identifier str
    The ID or Amazon Resource Name (ARN) of the target group.
    target Property Map
    The target.
    targetGroupIdentifier String
    The ID or Amazon Resource Name (ARN) of the target group.

    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,
            target: Optional[TargetGroupAttachmentTargetArgs] = None,
            target_group_identifier: 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:
    Target TargetGroupAttachmentTarget
    The target.
    TargetGroupIdentifier string
    The ID or Amazon Resource Name (ARN) of the target group.
    Target TargetGroupAttachmentTargetArgs
    The target.
    TargetGroupIdentifier string
    The ID or Amazon Resource Name (ARN) of the target group.
    target TargetGroupAttachmentTarget
    The target.
    targetGroupIdentifier String
    The ID or Amazon Resource Name (ARN) of the target group.
    target TargetGroupAttachmentTarget
    The target.
    targetGroupIdentifier string
    The ID or Amazon Resource Name (ARN) of the target group.
    target TargetGroupAttachmentTargetArgs
    The target.
    target_group_identifier str
    The ID or Amazon Resource Name (ARN) of the target group.
    target Property Map
    The target.
    targetGroupIdentifier String
    The ID or Amazon Resource Name (ARN) of the target group.

    Supporting Types

    TargetGroupAttachmentTarget, TargetGroupAttachmentTargetArgs

    Id string
    The ID of the target. If the target type of the target group is INSTANCE, this is an instance ID. If the target type is IP , this is an IP address. If the target type is LAMBDA, this is the ARN of the Lambda function. If the target type is ALB, this is the ARN of the Application Load Balancer.
    Port int
    This port is used for routing traffic to the target, and defaults to the target group port. However, you can override the default and specify a custom port.
    Id string
    The ID of the target. If the target type of the target group is INSTANCE, this is an instance ID. If the target type is IP , this is an IP address. If the target type is LAMBDA, this is the ARN of the Lambda function. If the target type is ALB, this is the ARN of the Application Load Balancer.
    Port int
    This port is used for routing traffic to the target, and defaults to the target group port. However, you can override the default and specify a custom port.
    id String
    The ID of the target. If the target type of the target group is INSTANCE, this is an instance ID. If the target type is IP , this is an IP address. If the target type is LAMBDA, this is the ARN of the Lambda function. If the target type is ALB, this is the ARN of the Application Load Balancer.
    port Integer
    This port is used for routing traffic to the target, and defaults to the target group port. However, you can override the default and specify a custom port.
    id string
    The ID of the target. If the target type of the target group is INSTANCE, this is an instance ID. If the target type is IP , this is an IP address. If the target type is LAMBDA, this is the ARN of the Lambda function. If the target type is ALB, this is the ARN of the Application Load Balancer.
    port number
    This port is used for routing traffic to the target, and defaults to the target group port. However, you can override the default and specify a custom port.
    id str
    The ID of the target. If the target type of the target group is INSTANCE, this is an instance ID. If the target type is IP , this is an IP address. If the target type is LAMBDA, this is the ARN of the Lambda function. If the target type is ALB, this is the ARN of the Application Load Balancer.
    port int
    This port is used for routing traffic to the target, and defaults to the target group port. However, you can override the default and specify a custom port.
    id String
    The ID of the target. If the target type of the target group is INSTANCE, this is an instance ID. If the target type is IP , this is an IP address. If the target type is LAMBDA, this is the ARN of the Lambda function. If the target type is ALB, this is the ARN of the Application Load Balancer.
    port Number
    This port is used for routing traffic to the target, and defaults to the target group port. However, you can override the default and specify a custom port.

    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.42.0 published on Wednesday, Jun 26, 2024 by Pulumi