Package com.pulumi.aws.autoscaling
Class Attachment
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.autoscaling.Attachment
-
public class Attachment extends com.pulumi.resources.CustomResource
Attaches a load balancer to an Auto Scaling group. > **NOTE on Auto Scaling Groups, Attachments and Traffic Source Attachments:** Pulumi provides standalone Attachment (for attaching Classic Load Balancers and Application Load Balancer, Gateway Load Balancer, or Network Load Balancer target groups) and Traffic Source Attachment (for attaching Load Balancers and VPC Lattice target groups) resources and an Auto Scaling Group resource with `load_balancers`, `target_group_arns` and `traffic_source` attributes. Do not use the same traffic source in more than one of these resources. Doing so will cause a conflict of attachments. A `lifecycle` configuration block can be used to suppress differences if necessary. ## Example Usage <!--Start PulumiCodeChooser -->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) { // Create a new load balancer attachment var example = new Attachment("example", AttachmentArgs.builder() .autoscalingGroupName(exampleAwsAutoscalingGroup.id()) .elb(exampleAwsElb.id()) .build()); } }
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) { // Create a new ALB Target Group attachment var example = new Attachment("example", AttachmentArgs.builder() .autoscalingGroupName(exampleAwsAutoscalingGroup.id()) .lbTargetGroupArn(exampleAwsLbTargetGroup.arn()) .build()); } }
-
-
Constructor Summary
Constructors Constructor Description Attachment(java.lang.String name)
Attachment(java.lang.String name, AttachmentArgs args)
Attachment(java.lang.String name, AttachmentArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.lang.String>
autoscalingGroupName()
com.pulumi.core.Output<java.util.Optional<java.lang.String>>
elb()
static Attachment
get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, AttachmentState state, com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.util.Optional<java.lang.String>>
lbTargetGroupArn()
-
-
-
Constructor Detail
-
Attachment
public Attachment(java.lang.String name)
- Parameters:
name
- The _unique_ name of the resulting resource.
-
Attachment
public Attachment(java.lang.String name, AttachmentArgs args)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.
-
Attachment
public Attachment(java.lang.String name, AttachmentArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.options
- A bag of options that control this resource's behavior.
-
-
Method Detail
-
autoscalingGroupName
public com.pulumi.core.Output<java.lang.String> autoscalingGroupName()
- Returns:
- Name of ASG to associate with the ELB.
-
elb
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> elb()
- Returns:
- Name of the ELB.
-
lbTargetGroupArn
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> lbTargetGroupArn()
- Returns:
- ARN of a load balancer target group.
-
get
public static Attachment get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable AttachmentState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name
- The _unique_ name of the resulting resource.id
- The _unique_ provider ID of the resource to lookup.state
-options
- Optional settings to control the behavior of the CustomResource.
-
-