AttachmentArgs

data class AttachmentArgs(val albTargetGroupArn: Output<String>? = null, val autoscalingGroupName: Output<String>? = null, val elb: Output<String>? = null, val lbTargetGroupArn: Output<String>? = null) : ConvertibleToJava<AttachmentArgs>

Provides an Auto Scaling Attachment resource.

NOTE on Auto Scaling Groups and ASG Attachments: This provider currently provides both a standalone aws.autoscaling.Attachment resource (describing an ASG attached to an ELB or ALB), and an aws.autoscaling.Group with load_balancers and target_group_arns defined in-line. These two methods are not mutually-exclusive. If aws.autoscaling.Attachment resources are used, either alone or with inline load_balancers or target_group_arns, the aws.autoscaling.Group resource must be configured to ignore changes to the load_balancers and target_group_arns arguments.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.autoscaling.Attachment;
import com.pulumi.aws.autoscaling.AttachmentArgs;
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 asgAttachmentBar = new Attachment("asgAttachmentBar", AttachmentArgs.builder()
.autoscalingGroupName(aws_autoscaling_group.asg().id())
.elb(aws_elb.bar().id())
.build());
}
}

With An AutoScaling Group Resource

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
// ... other configuration ...
const asg = new aws.autoscaling.Group("asg", {});
const asgAttachmentBar = new aws.autoscaling.Attachment("asgAttachmentBar", {
autoscalingGroupName: asg.id,
elb: aws_elb.test.id,
});
import pulumi
import pulumi_aws as aws
# ... other configuration ...
asg = aws.autoscaling.Group("asg")
asg_attachment_bar = aws.autoscaling.Attachment("asgAttachmentBar",
autoscaling_group_name=asg.id,
elb=aws_elb["test"]["id"])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
// ... other configuration ...
var asg = new Aws.AutoScaling.Group("asg");
var asgAttachmentBar = new Aws.AutoScaling.Attachment("asgAttachmentBar", new()
{
AutoscalingGroupName = asg.Id,
Elb = aws_elb.Test.Id,
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/autoscaling"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
asg, err := autoscaling.NewGroup(ctx, "asg", nil)
if err != nil {
return err
}
_, err = autoscaling.NewAttachment(ctx, "asgAttachmentBar", &autoscaling.AttachmentArgs{
AutoscalingGroupName: asg.ID(),
Elb: pulumi.Any(aws_elb.Test.Id),
})
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.autoscaling.Group;
import com.pulumi.aws.autoscaling.Attachment;
import com.pulumi.aws.autoscaling.AttachmentArgs;
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 asg = new Group("asg");
var asgAttachmentBar = new Attachment("asgAttachmentBar", AttachmentArgs.builder()
.autoscalingGroupName(asg.id())
.elb(aws_elb.test().id())
.build());
}
}
resources:
asg:
type: aws:autoscaling:Group
asgAttachmentBar:
type: aws:autoscaling:Attachment
properties:
autoscalingGroupName: ${asg.id}
elb: ${aws_elb.test.id}

Constructors

Link copied to clipboard
constructor(albTargetGroupArn: Output<String>? = null, autoscalingGroupName: Output<String>? = null, elb: Output<String>? = null, lbTargetGroupArn: Output<String>? = null)

Properties

Link copied to clipboard
val albTargetGroupArn: Output<String>? = null

ARN of an ALB Target Group.

Link copied to clipboard
val autoscalingGroupName: Output<String>? = null

Name of ASG to associate with the ELB.

Link copied to clipboard
val elb: Output<String>? = null

Name of the ELB.

Link copied to clipboard
val lbTargetGroupArn: Output<String>? = null

ARN of a load balancer target group.

Functions

Link copied to clipboard
open override fun toJava(): AttachmentArgs