aws.autoscaling.TrafficSourceAttachment
Explore with Pulumi AI
Attaches a traffic source 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
andtraffic_source
attributes. Do not use the same traffic source in more than one of these resources. Doing so will cause a conflict of attachments. Alifecycle
configuration block can be used to suppress differences if necessary.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.autoscaling.TrafficSourceAttachment("example", {
autoscalingGroupName: exampleAwsAutoscalingGroup.id,
trafficSource: {
identifier: exampleAwsLbTargetGroup.arn,
type: "elbv2",
},
});
import pulumi
import pulumi_aws as aws
example = aws.autoscaling.TrafficSourceAttachment("example",
autoscaling_group_name=example_aws_autoscaling_group["id"],
traffic_source={
"identifier": example_aws_lb_target_group["arn"],
"type": "elbv2",
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/autoscaling"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := autoscaling.NewTrafficSourceAttachment(ctx, "example", &autoscaling.TrafficSourceAttachmentArgs{
AutoscalingGroupName: pulumi.Any(exampleAwsAutoscalingGroup.Id),
TrafficSource: &autoscaling.TrafficSourceAttachmentTrafficSourceArgs{
Identifier: pulumi.Any(exampleAwsLbTargetGroup.Arn),
Type: pulumi.String("elbv2"),
},
})
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.AutoScaling.TrafficSourceAttachment("example", new()
{
AutoscalingGroupName = exampleAwsAutoscalingGroup.Id,
TrafficSource = new Aws.AutoScaling.Inputs.TrafficSourceAttachmentTrafficSourceArgs
{
Identifier = exampleAwsLbTargetGroup.Arn,
Type = "elbv2",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.autoscaling.TrafficSourceAttachment;
import com.pulumi.aws.autoscaling.TrafficSourceAttachmentArgs;
import com.pulumi.aws.autoscaling.inputs.TrafficSourceAttachmentTrafficSourceArgs;
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 TrafficSourceAttachment("example", TrafficSourceAttachmentArgs.builder()
.autoscalingGroupName(exampleAwsAutoscalingGroup.id())
.trafficSource(TrafficSourceAttachmentTrafficSourceArgs.builder()
.identifier(exampleAwsLbTargetGroup.arn())
.type("elbv2")
.build())
.build());
}
}
resources:
example:
type: aws:autoscaling:TrafficSourceAttachment
properties:
autoscalingGroupName: ${exampleAwsAutoscalingGroup.id}
trafficSource:
identifier: ${exampleAwsLbTargetGroup.arn}
type: elbv2
Create TrafficSourceAttachment Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new TrafficSourceAttachment(name: string, args: TrafficSourceAttachmentArgs, opts?: CustomResourceOptions);
@overload
def TrafficSourceAttachment(resource_name: str,
args: TrafficSourceAttachmentArgs,
opts: Optional[ResourceOptions] = None)
@overload
def TrafficSourceAttachment(resource_name: str,
opts: Optional[ResourceOptions] = None,
autoscaling_group_name: Optional[str] = None,
traffic_source: Optional[TrafficSourceAttachmentTrafficSourceArgs] = None)
func NewTrafficSourceAttachment(ctx *Context, name string, args TrafficSourceAttachmentArgs, opts ...ResourceOption) (*TrafficSourceAttachment, error)
public TrafficSourceAttachment(string name, TrafficSourceAttachmentArgs args, CustomResourceOptions? opts = null)
public TrafficSourceAttachment(String name, TrafficSourceAttachmentArgs args)
public TrafficSourceAttachment(String name, TrafficSourceAttachmentArgs args, CustomResourceOptions options)
type: aws:autoscaling:TrafficSourceAttachment
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 TrafficSourceAttachmentArgs
- 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 TrafficSourceAttachmentArgs
- 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 TrafficSourceAttachmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TrafficSourceAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args TrafficSourceAttachmentArgs
- 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 trafficSourceAttachmentResource = new Aws.AutoScaling.TrafficSourceAttachment("trafficSourceAttachmentResource", new()
{
AutoscalingGroupName = "string",
TrafficSource = new Aws.AutoScaling.Inputs.TrafficSourceAttachmentTrafficSourceArgs
{
Identifier = "string",
Type = "string",
},
});
example, err := autoscaling.NewTrafficSourceAttachment(ctx, "trafficSourceAttachmentResource", &autoscaling.TrafficSourceAttachmentArgs{
AutoscalingGroupName: pulumi.String("string"),
TrafficSource: &autoscaling.TrafficSourceAttachmentTrafficSourceArgs{
Identifier: pulumi.String("string"),
Type: pulumi.String("string"),
},
})
var trafficSourceAttachmentResource = new TrafficSourceAttachment("trafficSourceAttachmentResource", TrafficSourceAttachmentArgs.builder()
.autoscalingGroupName("string")
.trafficSource(TrafficSourceAttachmentTrafficSourceArgs.builder()
.identifier("string")
.type("string")
.build())
.build());
traffic_source_attachment_resource = aws.autoscaling.TrafficSourceAttachment("trafficSourceAttachmentResource",
autoscaling_group_name="string",
traffic_source={
"identifier": "string",
"type": "string",
})
const trafficSourceAttachmentResource = new aws.autoscaling.TrafficSourceAttachment("trafficSourceAttachmentResource", {
autoscalingGroupName: "string",
trafficSource: {
identifier: "string",
type: "string",
},
});
type: aws:autoscaling:TrafficSourceAttachment
properties:
autoscalingGroupName: string
trafficSource:
identifier: string
type: string
TrafficSourceAttachment Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The TrafficSourceAttachment resource accepts the following input properties:
- Autoscaling
Group stringName - The name of the Auto Scaling group.
- Traffic
Source TrafficSource Attachment Traffic Source - The unique identifiers of a traffic sources.
- Autoscaling
Group stringName - The name of the Auto Scaling group.
- Traffic
Source TrafficSource Attachment Traffic Source Args - The unique identifiers of a traffic sources.
- autoscaling
Group StringName - The name of the Auto Scaling group.
- traffic
Source TrafficSource Attachment Traffic Source - The unique identifiers of a traffic sources.
- autoscaling
Group stringName - The name of the Auto Scaling group.
- traffic
Source TrafficSource Attachment Traffic Source - The unique identifiers of a traffic sources.
- autoscaling_
group_ strname - The name of the Auto Scaling group.
- traffic_
source TrafficSource Attachment Traffic Source Args - The unique identifiers of a traffic sources.
- autoscaling
Group StringName - The name of the Auto Scaling group.
- traffic
Source Property Map - The unique identifiers of a traffic sources.
Outputs
All input properties are implicitly available as output properties. Additionally, the TrafficSourceAttachment 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 TrafficSourceAttachment Resource
Get an existing TrafficSourceAttachment 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?: TrafficSourceAttachmentState, opts?: CustomResourceOptions): TrafficSourceAttachment
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
autoscaling_group_name: Optional[str] = None,
traffic_source: Optional[TrafficSourceAttachmentTrafficSourceArgs] = None) -> TrafficSourceAttachment
func GetTrafficSourceAttachment(ctx *Context, name string, id IDInput, state *TrafficSourceAttachmentState, opts ...ResourceOption) (*TrafficSourceAttachment, error)
public static TrafficSourceAttachment Get(string name, Input<string> id, TrafficSourceAttachmentState? state, CustomResourceOptions? opts = null)
public static TrafficSourceAttachment get(String name, Output<String> id, TrafficSourceAttachmentState 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.
- Autoscaling
Group stringName - The name of the Auto Scaling group.
- Traffic
Source TrafficSource Attachment Traffic Source - The unique identifiers of a traffic sources.
- Autoscaling
Group stringName - The name of the Auto Scaling group.
- Traffic
Source TrafficSource Attachment Traffic Source Args - The unique identifiers of a traffic sources.
- autoscaling
Group StringName - The name of the Auto Scaling group.
- traffic
Source TrafficSource Attachment Traffic Source - The unique identifiers of a traffic sources.
- autoscaling
Group stringName - The name of the Auto Scaling group.
- traffic
Source TrafficSource Attachment Traffic Source - The unique identifiers of a traffic sources.
- autoscaling_
group_ strname - The name of the Auto Scaling group.
- traffic_
source TrafficSource Attachment Traffic Source Args - The unique identifiers of a traffic sources.
- autoscaling
Group StringName - The name of the Auto Scaling group.
- traffic
Source Property Map - The unique identifiers of a traffic sources.
Supporting Types
TrafficSourceAttachmentTrafficSource, TrafficSourceAttachmentTrafficSourceArgs
- Identifier string
- Identifies the traffic source. For Application Load Balancers, Gateway Load Balancers, Network Load Balancers, and VPC Lattice, this will be the Amazon Resource Name (ARN) for a target group in this account and Region. For Classic Load Balancers, this will be the name of the Classic Load Balancer in this account and Region.
- Type string
- Provides additional context for the value of
identifier
. The following lists the valid values:elb
ifidentifier
is the name of a Classic Load Balancer.elbv2
ifidentifier
is the ARN of an Application Load Balancer, Gateway Load Balancer, or Network Load Balancer target group.vpc-lattice
ifidentifier
is the ARN of a VPC Lattice target group.
- Identifier string
- Identifies the traffic source. For Application Load Balancers, Gateway Load Balancers, Network Load Balancers, and VPC Lattice, this will be the Amazon Resource Name (ARN) for a target group in this account and Region. For Classic Load Balancers, this will be the name of the Classic Load Balancer in this account and Region.
- Type string
- Provides additional context for the value of
identifier
. The following lists the valid values:elb
ifidentifier
is the name of a Classic Load Balancer.elbv2
ifidentifier
is the ARN of an Application Load Balancer, Gateway Load Balancer, or Network Load Balancer target group.vpc-lattice
ifidentifier
is the ARN of a VPC Lattice target group.
- identifier String
- Identifies the traffic source. For Application Load Balancers, Gateway Load Balancers, Network Load Balancers, and VPC Lattice, this will be the Amazon Resource Name (ARN) for a target group in this account and Region. For Classic Load Balancers, this will be the name of the Classic Load Balancer in this account and Region.
- type String
- Provides additional context for the value of
identifier
. The following lists the valid values:elb
ifidentifier
is the name of a Classic Load Balancer.elbv2
ifidentifier
is the ARN of an Application Load Balancer, Gateway Load Balancer, or Network Load Balancer target group.vpc-lattice
ifidentifier
is the ARN of a VPC Lattice target group.
- identifier string
- Identifies the traffic source. For Application Load Balancers, Gateway Load Balancers, Network Load Balancers, and VPC Lattice, this will be the Amazon Resource Name (ARN) for a target group in this account and Region. For Classic Load Balancers, this will be the name of the Classic Load Balancer in this account and Region.
- type string
- Provides additional context for the value of
identifier
. The following lists the valid values:elb
ifidentifier
is the name of a Classic Load Balancer.elbv2
ifidentifier
is the ARN of an Application Load Balancer, Gateway Load Balancer, or Network Load Balancer target group.vpc-lattice
ifidentifier
is the ARN of a VPC Lattice target group.
- identifier str
- Identifies the traffic source. For Application Load Balancers, Gateway Load Balancers, Network Load Balancers, and VPC Lattice, this will be the Amazon Resource Name (ARN) for a target group in this account and Region. For Classic Load Balancers, this will be the name of the Classic Load Balancer in this account and Region.
- type str
- Provides additional context for the value of
identifier
. The following lists the valid values:elb
ifidentifier
is the name of a Classic Load Balancer.elbv2
ifidentifier
is the ARN of an Application Load Balancer, Gateway Load Balancer, or Network Load Balancer target group.vpc-lattice
ifidentifier
is the ARN of a VPC Lattice target group.
- identifier String
- Identifies the traffic source. For Application Load Balancers, Gateway Load Balancers, Network Load Balancers, and VPC Lattice, this will be the Amazon Resource Name (ARN) for a target group in this account and Region. For Classic Load Balancers, this will be the name of the Classic Load Balancer in this account and Region.
- type String
- Provides additional context for the value of
identifier
. The following lists the valid values:elb
ifidentifier
is the name of a Classic Load Balancer.elbv2
ifidentifier
is the ARN of an Application Load Balancer, Gateway Load Balancer, or Network Load Balancer target group.vpc-lattice
ifidentifier
is the ARN of a VPC Lattice target group.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.