UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

78 lines 3.77 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.TrafficSourceAttachment = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * 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 `loadBalancers`, `targetGroupArns` and `trafficSource` 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 * * ### Basic Usage * * ```typescript * 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", * }, * }); * ``` */ class TrafficSourceAttachment extends pulumi.CustomResource { /** * Get an existing TrafficSourceAttachment resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new TrafficSourceAttachment(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of TrafficSourceAttachment. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === TrafficSourceAttachment.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["autoscalingGroupName"] = state?.autoscalingGroupName; resourceInputs["region"] = state?.region; resourceInputs["trafficSource"] = state?.trafficSource; } else { const args = argsOrState; if (args?.autoscalingGroupName === undefined && !opts.urn) { throw new Error("Missing required property 'autoscalingGroupName'"); } resourceInputs["autoscalingGroupName"] = args?.autoscalingGroupName; resourceInputs["region"] = args?.region; resourceInputs["trafficSource"] = args?.trafficSource; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(TrafficSourceAttachment.__pulumiType, name, resourceInputs, opts); } } exports.TrafficSourceAttachment = TrafficSourceAttachment; /** @internal */ TrafficSourceAttachment.__pulumiType = 'aws:autoscaling/trafficSourceAttachment:TrafficSourceAttachment'; //# sourceMappingURL=trafficSourceAttachment.js.map