UNPKG

@pulumi/aws

Version:

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

178 lines 7.65 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.LoadBalancer = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides an Elastic Load Balancer resource, also known as a "Classic * Load Balancer" after the release of * Application/Network Load Balancers. * * > **NOTE on ELB Instances and ELB Attachments:** This provider currently * provides both a standalone ELB Attachment resource * (describing an instance attached to an ELB), and an ELB resource with * `instances` defined in-line. At this time you cannot use an ELB with in-line * instances in conjunction with a ELB Attachment resources. Doing so will cause a * conflict and will overwrite attachments. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * // Create a new load balancer * const bar = new aws.elb.LoadBalancer("bar", { * name: "foobar-elb", * availabilityZones: [ * "us-west-2a", * "us-west-2b", * "us-west-2c", * ], * accessLogs: { * bucket: "foo", * bucketPrefix: "bar", * interval: 60, * }, * listeners: [ * { * instancePort: 8000, * instanceProtocol: "http", * lbPort: 80, * lbProtocol: "http", * }, * { * instancePort: 8000, * instanceProtocol: "http", * lbPort: 443, * lbProtocol: "https", * sslCertificateId: "arn:aws:iam::123456789012:server-certificate/certName", * }, * ], * healthCheck: { * healthyThreshold: 2, * unhealthyThreshold: 2, * timeout: 3, * target: "HTTP:8000/", * interval: 30, * }, * instances: [foo.id], * crossZoneLoadBalancing: true, * idleTimeout: 400, * connectionDraining: true, * connectionDrainingTimeout: 400, * tags: { * Name: "foobar-elb", * }, * }); * ``` * * ## Note on ECDSA Key Algorithm * * If the ARN of the `sslCertificateId` that is pointed to references a * certificate that was signed by an ECDSA key, note that ELB only supports the * P256 and P384 curves. Using a certificate signed by a key using a different * curve could produce the error `ERR_SSL_VERSION_OR_CIPHER_MISMATCH` in your * browser. * * ## Import * * Using `pulumi import`, import ELBs using the `name`. For example: * * ```sh * $ pulumi import aws:elb/loadBalancer:LoadBalancer bar elb-production-12345 * ``` */ class LoadBalancer extends pulumi.CustomResource { /** * Get an existing LoadBalancer 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 LoadBalancer(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of LoadBalancer. 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'] === LoadBalancer.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accessLogs"] = state?.accessLogs; resourceInputs["arn"] = state?.arn; resourceInputs["availabilityZones"] = state?.availabilityZones; resourceInputs["connectionDraining"] = state?.connectionDraining; resourceInputs["connectionDrainingTimeout"] = state?.connectionDrainingTimeout; resourceInputs["crossZoneLoadBalancing"] = state?.crossZoneLoadBalancing; resourceInputs["desyncMitigationMode"] = state?.desyncMitigationMode; resourceInputs["dnsName"] = state?.dnsName; resourceInputs["healthCheck"] = state?.healthCheck; resourceInputs["idleTimeout"] = state?.idleTimeout; resourceInputs["instances"] = state?.instances; resourceInputs["internal"] = state?.internal; resourceInputs["listeners"] = state?.listeners; resourceInputs["name"] = state?.name; resourceInputs["namePrefix"] = state?.namePrefix; resourceInputs["region"] = state?.region; resourceInputs["securityGroups"] = state?.securityGroups; resourceInputs["sourceSecurityGroup"] = state?.sourceSecurityGroup; resourceInputs["sourceSecurityGroupId"] = state?.sourceSecurityGroupId; resourceInputs["subnets"] = state?.subnets; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["zoneId"] = state?.zoneId; } else { const args = argsOrState; if (args?.listeners === undefined && !opts.urn) { throw new Error("Missing required property 'listeners'"); } resourceInputs["accessLogs"] = args?.accessLogs; resourceInputs["availabilityZones"] = args?.availabilityZones; resourceInputs["connectionDraining"] = args?.connectionDraining; resourceInputs["connectionDrainingTimeout"] = args?.connectionDrainingTimeout; resourceInputs["crossZoneLoadBalancing"] = args?.crossZoneLoadBalancing; resourceInputs["desyncMitigationMode"] = args?.desyncMitigationMode; resourceInputs["healthCheck"] = args?.healthCheck; resourceInputs["idleTimeout"] = args?.idleTimeout; resourceInputs["instances"] = args?.instances; resourceInputs["internal"] = args?.internal; resourceInputs["listeners"] = args?.listeners; resourceInputs["name"] = args?.name; resourceInputs["namePrefix"] = args?.namePrefix; resourceInputs["region"] = args?.region; resourceInputs["securityGroups"] = args?.securityGroups; resourceInputs["sourceSecurityGroup"] = args?.sourceSecurityGroup; resourceInputs["subnets"] = args?.subnets; resourceInputs["tags"] = args?.tags; resourceInputs["arn"] = undefined /*out*/; resourceInputs["dnsName"] = undefined /*out*/; resourceInputs["sourceSecurityGroupId"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; resourceInputs["zoneId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const aliasOpts = { aliases: [{ type: "aws:elasticloadbalancing/loadBalancer:LoadBalancer" }] }; opts = pulumi.mergeOptions(opts, aliasOpts); super(LoadBalancer.__pulumiType, name, resourceInputs, opts); } } exports.LoadBalancer = LoadBalancer; /** @internal */ LoadBalancer.__pulumiType = 'aws:elb/loadBalancer:LoadBalancer'; //# sourceMappingURL=loadBalancer.js.map