1. Packages
  2. AWSx (Pulumi Crosswalk for AWS)
  3. API Docs
  4. lb
  5. TargetGroupAttachment
AWSx (Pulumi Crosswalk for AWS) v2.8.0 published on Friday, Apr 19, 2024 by Pulumi

awsx.lb.TargetGroupAttachment

Explore with Pulumi AI

awsx logo
AWSx (Pulumi Crosswalk for AWS) v2.8.0 published on Friday, Apr 19, 2024 by Pulumi

    Attach an EC2 instance or Lambda to a Load Balancer. This will create required permissions if attaching to a Lambda Function.

    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: Optional[TargetGroupAttachmentArgs] = None,
                              opts: Optional[ResourceOptions] = None)
    
    @overload
    def TargetGroupAttachment(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              instance: Optional[pulumi_aws.ec2.Instance] = None,
                              instance_id: Optional[str] = None,
                              lambda_: Optional[pulumi_aws.lambda_.Function] = None,
                              lambda_arn: Optional[str] = None,
                              target_group: Optional[pulumi_aws.lb.TargetGroup] = None,
                              target_group_arn: Optional[str] = None)
    func NewTargetGroupAttachment(ctx *Context, name string, args *TargetGroupAttachmentArgs, opts ...ResourceOption) (*TargetGroupAttachment, error)
    public TargetGroupAttachment(string name, TargetGroupAttachmentArgs? args = null, CustomResourceOptions? opts = null)
    public TargetGroupAttachment(String name, TargetGroupAttachmentArgs args)
    public TargetGroupAttachment(String name, TargetGroupAttachmentArgs args, CustomResourceOptions options)
    
    type: awsx:lb: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.

    Example

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

    var targetGroupAttachmentResource = new Awsx.Lb.TargetGroupAttachment("targetGroupAttachmentResource", new()
    {
        Instance = instance,
        InstanceId = "string",
        Lambda = function,
        LambdaArn = "string",
        TargetGroup = targetGroup,
        TargetGroupArn = "string",
    });
    
    Coming soon!
    
    var targetGroupAttachmentResource = new TargetGroupAttachment("targetGroupAttachmentResource", TargetGroupAttachmentArgs.builder()        
        .instance(instance)
        .instanceId("string")
        .lambda(function)
        .lambdaArn("string")
        .targetGroup(targetGroup)
        .targetGroupArn("string")
        .build());
    
    target_group_attachment_resource = awsx.lb.TargetGroupAttachment("targetGroupAttachmentResource",
        instance=instance,
        instance_id="string",
        lambda_=function,
        lambda_arn="string",
        target_group=target_group,
        target_group_arn="string")
    
    const targetGroupAttachmentResource = new awsx.lb.TargetGroupAttachment("targetGroupAttachmentResource", {
        instance: instance,
        instanceId: "string",
        lambda: _function,
        lambdaArn: "string",
        targetGroup: targetGroup,
        targetGroupArn: "string",
    });
    
    type: awsx:lb:TargetGroupAttachment
    properties:
        instance: ${instance}
        instanceId: string
        lambda: ${function}
        lambdaArn: string
        targetGroup: ${targetGroup}
        targetGroupArn: 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:

    Instance Pulumi.Aws.Ec2.Instance
    EC2 Instance to attach to the Target Group. Exactly 1 of [instance], [instanceId], [lambda] or [lambdaArn] must be provided. This type is defined in the AWS Classic package.
    InstanceId string
    ID of an EC2 Instance to attach to the Target Group. Exactly 1 of [instance], [instanceId], [lambda] or [lambdaArn] must be provided.
    Lambda Pulumi.Aws.Lambda.Function
    Lambda Function to attach to the Target Group. Exactly 1 of [instance], [instanceId], [lambda] or [lambdaArn] must be provided. This type is defined in the AWS Classic package.
    LambdaArn string
    ARN of a Lambda Function to attach to the Target Group. Exactly 1 of [instance], [instanceId], [lambda] or [lambdaArn] must be provided.
    TargetGroup Pulumi.Aws.LB.TargetGroup
    Target Group to attach to. Exactly one of [targetGroup] or [targetGroupArn] must be specified. This type is defined in the AWS Classic package.
    TargetGroupArn string
    ARN of the Target Group to attach to. Exactly one of [targetGroup] or [targetGroupArn] must be specified.
    Instance Instance
    EC2 Instance to attach to the Target Group. Exactly 1 of [instance], [instanceId], [lambda] or [lambdaArn] must be provided. This type is defined in the AWS Classic package.
    InstanceId string
    ID of an EC2 Instance to attach to the Target Group. Exactly 1 of [instance], [instanceId], [lambda] or [lambdaArn] must be provided.
    Lambda Function
    Lambda Function to attach to the Target Group. Exactly 1 of [instance], [instanceId], [lambda] or [lambdaArn] must be provided. This type is defined in the AWS Classic package.
    LambdaArn string
    ARN of a Lambda Function to attach to the Target Group. Exactly 1 of [instance], [instanceId], [lambda] or [lambdaArn] must be provided.
    TargetGroup TargetGroup
    Target Group to attach to. Exactly one of [targetGroup] or [targetGroupArn] must be specified. This type is defined in the AWS Classic package.
    TargetGroupArn string
    ARN of the Target Group to attach to. Exactly one of [targetGroup] or [targetGroupArn] must be specified.
    instance Instance
    EC2 Instance to attach to the Target Group. Exactly 1 of [instance], [instanceId], [lambda] or [lambdaArn] must be provided. This type is defined in the AWS Classic package.
    instanceId String
    ID of an EC2 Instance to attach to the Target Group. Exactly 1 of [instance], [instanceId], [lambda] or [lambdaArn] must be provided.
    lambda Function
    Lambda Function to attach to the Target Group. Exactly 1 of [instance], [instanceId], [lambda] or [lambdaArn] must be provided. This type is defined in the AWS Classic package.
    lambdaArn String
    ARN of a Lambda Function to attach to the Target Group. Exactly 1 of [instance], [instanceId], [lambda] or [lambdaArn] must be provided.
    targetGroup TargetGroup
    Target Group to attach to. Exactly one of [targetGroup] or [targetGroupArn] must be specified. This type is defined in the AWS Classic package.
    targetGroupArn String
    ARN of the Target Group to attach to. Exactly one of [targetGroup] or [targetGroupArn] must be specified.
    instance pulumiAws.ec2.Instance
    EC2 Instance to attach to the Target Group. Exactly 1 of [instance], [instanceId], [lambda] or [lambdaArn] must be provided. This type is defined in the AWS Classic package.
    instanceId string
    ID of an EC2 Instance to attach to the Target Group. Exactly 1 of [instance], [instanceId], [lambda] or [lambdaArn] must be provided.
    lambda pulumiAws.lambda.Function
    Lambda Function to attach to the Target Group. Exactly 1 of [instance], [instanceId], [lambda] or [lambdaArn] must be provided. This type is defined in the AWS Classic package.
    lambdaArn string
    ARN of a Lambda Function to attach to the Target Group. Exactly 1 of [instance], [instanceId], [lambda] or [lambdaArn] must be provided.
    targetGroup pulumiAws.TargetGroup
    Target Group to attach to. Exactly one of [targetGroup] or [targetGroupArn] must be specified. This type is defined in the AWS Classic package.
    targetGroupArn string
    ARN of the Target Group to attach to. Exactly one of [targetGroup] or [targetGroupArn] must be specified.
    instance pulumi_aws.ec2.Instance
    EC2 Instance to attach to the Target Group. Exactly 1 of [instance], [instanceId], [lambda] or [lambdaArn] must be provided. This type is defined in the AWS Classic package.
    instance_id str
    ID of an EC2 Instance to attach to the Target Group. Exactly 1 of [instance], [instanceId], [lambda] or [lambdaArn] must be provided.
    lambda_ pulumi_aws.lambda_.Function
    Lambda Function to attach to the Target Group. Exactly 1 of [instance], [instanceId], [lambda] or [lambdaArn] must be provided. This type is defined in the AWS Classic package.
    lambda_arn str
    ARN of a Lambda Function to attach to the Target Group. Exactly 1 of [instance], [instanceId], [lambda] or [lambdaArn] must be provided.
    target_group pulumi_aws.lb.TargetGroup
    Target Group to attach to. Exactly one of [targetGroup] or [targetGroupArn] must be specified. This type is defined in the AWS Classic package.
    target_group_arn str
    ARN of the Target Group to attach to. Exactly one of [targetGroup] or [targetGroupArn] must be specified.
    instance aws:ec2:Instance
    EC2 Instance to attach to the Target Group. Exactly 1 of [instance], [instanceId], [lambda] or [lambdaArn] must be provided. This type is defined in the AWS Classic package.
    instanceId String
    ID of an EC2 Instance to attach to the Target Group. Exactly 1 of [instance], [instanceId], [lambda] or [lambdaArn] must be provided.
    lambda aws:lambda:Function
    Lambda Function to attach to the Target Group. Exactly 1 of [instance], [instanceId], [lambda] or [lambdaArn] must be provided. This type is defined in the AWS Classic package.
    lambdaArn String
    ARN of a Lambda Function to attach to the Target Group. Exactly 1 of [instance], [instanceId], [lambda] or [lambdaArn] must be provided.
    targetGroup aws::TargetGroup
    Target Group to attach to. Exactly one of [targetGroup] or [targetGroupArn] must be specified. This type is defined in the AWS Classic package.
    targetGroupArn String
    ARN of the Target Group to attach to. Exactly one of [targetGroup] or [targetGroupArn] must be specified.

    Outputs

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

    Attachment Pulumi.Aws.LB.TargetGroupAttachment
    Underlying Target Group Attachment resource This type is defined in the AWS Classic package.
    LambdaPermission Pulumi.Aws.Lambda.Permission
    Auto-created Lambda permission, if targeting a Lambda function This type is defined in the AWS Classic package.
    TargetGroupAttachment TargetGroupAttachment
    Underlying Target Group Attachment resource This type is defined in the AWS Classic package.
    LambdaPermission Permission
    Auto-created Lambda permission, if targeting a Lambda function This type is defined in the AWS Classic package.
    targetGroupAttachment TargetGroupAttachment
    Underlying Target Group Attachment resource This type is defined in the AWS Classic package.
    lambdaPermission Permission
    Auto-created Lambda permission, if targeting a Lambda function This type is defined in the AWS Classic package.
    targetGroupAttachment pulumiAws.TargetGroupAttachment
    Underlying Target Group Attachment resource This type is defined in the AWS Classic package.
    lambdaPermission pulumiAws.lambda.Permission
    Auto-created Lambda permission, if targeting a Lambda function This type is defined in the AWS Classic package.
    target_group_attachment pulumi_aws.lb.TargetGroupAttachment
    Underlying Target Group Attachment resource This type is defined in the AWS Classic package.
    lambda_permission pulumi_aws.lambda_.Permission
    Auto-created Lambda permission, if targeting a Lambda function This type is defined in the AWS Classic package.
    targetGroupAttachment aws::TargetGroupAttachment
    Underlying Target Group Attachment resource This type is defined in the AWS Classic package.
    lambdaPermission aws:lambda:Permission
    Auto-created Lambda permission, if targeting a Lambda function This type is defined in the AWS Classic package.

    Package Details

    Repository
    AWSx (Pulumi Crosswalk for AWS) pulumi/pulumi-awsx
    License
    Apache-2.0
    awsx logo
    AWSx (Pulumi Crosswalk for AWS) v2.8.0 published on Friday, Apr 19, 2024 by Pulumi