Attachment Args
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 anaws.autoscaling.Group
withload_balancers
andtarget_group_arns
defined in-line. These two methods are not mutually-exclusive. Ifaws.autoscaling.Attachment
resources are used, either alone or with inlineload_balancers
ortarget_group_arns
, theaws.autoscaling.Group
resource must be configured to ignore changes to theload_balancers
andtarget_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());
}
}
Content copied to clipboard
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,
});
Content copied to clipboard
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"])
Content copied to clipboard
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,
});
});
Content copied to clipboard
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
})
}
Content copied to clipboard
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());
}
}
Content copied to clipboard
resources:
asg:
type: aws:autoscaling:Group
asgAttachmentBar:
type: aws:autoscaling:Attachment
properties:
autoscalingGroupName: ${asg.id}
elb: ${aws_elb.test.id}
Content copied to clipboard