@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
222 lines • 11.1 kB
JavaScript
;
// *** 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 a Load Balancer resource.
*
* > **Note:** `aws.alb.LoadBalancer` is known as `aws.lb.LoadBalancer`. The functionality is identical.
*
* ## Example Usage
*
* ### Application Load Balancer
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const test = new aws.lb.LoadBalancer("test", {
* name: "test-lb-tf",
* internal: false,
* loadBalancerType: "application",
* securityGroups: [lbSg.id],
* subnets: .map(subnet => (subnet.id)),
* enableDeletionProtection: true,
* accessLogs: {
* bucket: lbLogs.id,
* prefix: "test-lb",
* enabled: true,
* },
* tags: {
* Environment: "production",
* },
* });
* ```
*
* ### Network Load Balancer
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const test = new aws.lb.LoadBalancer("test", {
* name: "test-lb-tf",
* internal: false,
* loadBalancerType: "network",
* subnets: .map(subnet => (subnet.id)),
* enableDeletionProtection: true,
* tags: {
* Environment: "production",
* },
* });
* ```
*
* ### Specifying Elastic IPs
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.lb.LoadBalancer("example", {
* name: "example",
* loadBalancerType: "network",
* subnetMappings: [
* {
* subnetId: example1AwsSubnet.id,
* allocationId: example1.id,
* },
* {
* subnetId: example2AwsSubnet.id,
* allocationId: example2.id,
* },
* ],
* });
* ```
*
* ### Specifying private IP addresses for an internal-facing load balancer
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.lb.LoadBalancer("example", {
* name: "example",
* loadBalancerType: "network",
* subnetMappings: [
* {
* subnetId: example1.id,
* privateIpv4Address: "10.0.1.15",
* },
* {
* subnetId: example2.id,
* privateIpv4Address: "10.0.2.15",
* },
* ],
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import LBs using their ARN. For example:
*
* ```sh
* $ pulumi import aws:lb/loadBalancer:LoadBalancer bar arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188
* ```
*/
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, Object.assign(Object.assign({}, 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 ? state.accessLogs : undefined;
resourceInputs["arn"] = state ? state.arn : undefined;
resourceInputs["arnSuffix"] = state ? state.arnSuffix : undefined;
resourceInputs["clientKeepAlive"] = state ? state.clientKeepAlive : undefined;
resourceInputs["connectionLogs"] = state ? state.connectionLogs : undefined;
resourceInputs["customerOwnedIpv4Pool"] = state ? state.customerOwnedIpv4Pool : undefined;
resourceInputs["desyncMitigationMode"] = state ? state.desyncMitigationMode : undefined;
resourceInputs["dnsName"] = state ? state.dnsName : undefined;
resourceInputs["dnsRecordClientRoutingPolicy"] = state ? state.dnsRecordClientRoutingPolicy : undefined;
resourceInputs["dropInvalidHeaderFields"] = state ? state.dropInvalidHeaderFields : undefined;
resourceInputs["enableCrossZoneLoadBalancing"] = state ? state.enableCrossZoneLoadBalancing : undefined;
resourceInputs["enableDeletionProtection"] = state ? state.enableDeletionProtection : undefined;
resourceInputs["enableHttp2"] = state ? state.enableHttp2 : undefined;
resourceInputs["enableTlsVersionAndCipherSuiteHeaders"] = state ? state.enableTlsVersionAndCipherSuiteHeaders : undefined;
resourceInputs["enableWafFailOpen"] = state ? state.enableWafFailOpen : undefined;
resourceInputs["enableXffClientPort"] = state ? state.enableXffClientPort : undefined;
resourceInputs["enableZonalShift"] = state ? state.enableZonalShift : undefined;
resourceInputs["enforceSecurityGroupInboundRulesOnPrivateLinkTraffic"] = state ? state.enforceSecurityGroupInboundRulesOnPrivateLinkTraffic : undefined;
resourceInputs["idleTimeout"] = state ? state.idleTimeout : undefined;
resourceInputs["internal"] = state ? state.internal : undefined;
resourceInputs["ipAddressType"] = state ? state.ipAddressType : undefined;
resourceInputs["ipamPools"] = state ? state.ipamPools : undefined;
resourceInputs["loadBalancerType"] = state ? state.loadBalancerType : undefined;
resourceInputs["minimumLoadBalancerCapacity"] = state ? state.minimumLoadBalancerCapacity : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["namePrefix"] = state ? state.namePrefix : undefined;
resourceInputs["preserveHostHeader"] = state ? state.preserveHostHeader : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["securityGroups"] = state ? state.securityGroups : undefined;
resourceInputs["subnetMappings"] = state ? state.subnetMappings : undefined;
resourceInputs["subnets"] = state ? state.subnets : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
resourceInputs["vpcId"] = state ? state.vpcId : undefined;
resourceInputs["xffHeaderProcessingMode"] = state ? state.xffHeaderProcessingMode : undefined;
resourceInputs["zoneId"] = state ? state.zoneId : undefined;
}
else {
const args = argsOrState;
resourceInputs["accessLogs"] = args ? args.accessLogs : undefined;
resourceInputs["clientKeepAlive"] = args ? args.clientKeepAlive : undefined;
resourceInputs["connectionLogs"] = args ? args.connectionLogs : undefined;
resourceInputs["customerOwnedIpv4Pool"] = args ? args.customerOwnedIpv4Pool : undefined;
resourceInputs["desyncMitigationMode"] = args ? args.desyncMitigationMode : undefined;
resourceInputs["dnsRecordClientRoutingPolicy"] = args ? args.dnsRecordClientRoutingPolicy : undefined;
resourceInputs["dropInvalidHeaderFields"] = args ? args.dropInvalidHeaderFields : undefined;
resourceInputs["enableCrossZoneLoadBalancing"] = args ? args.enableCrossZoneLoadBalancing : undefined;
resourceInputs["enableDeletionProtection"] = args ? args.enableDeletionProtection : undefined;
resourceInputs["enableHttp2"] = args ? args.enableHttp2 : undefined;
resourceInputs["enableTlsVersionAndCipherSuiteHeaders"] = args ? args.enableTlsVersionAndCipherSuiteHeaders : undefined;
resourceInputs["enableWafFailOpen"] = args ? args.enableWafFailOpen : undefined;
resourceInputs["enableXffClientPort"] = args ? args.enableXffClientPort : undefined;
resourceInputs["enableZonalShift"] = args ? args.enableZonalShift : undefined;
resourceInputs["enforceSecurityGroupInboundRulesOnPrivateLinkTraffic"] = args ? args.enforceSecurityGroupInboundRulesOnPrivateLinkTraffic : undefined;
resourceInputs["idleTimeout"] = args ? args.idleTimeout : undefined;
resourceInputs["internal"] = args ? args.internal : undefined;
resourceInputs["ipAddressType"] = args ? args.ipAddressType : undefined;
resourceInputs["ipamPools"] = args ? args.ipamPools : undefined;
resourceInputs["loadBalancerType"] = args ? args.loadBalancerType : undefined;
resourceInputs["minimumLoadBalancerCapacity"] = args ? args.minimumLoadBalancerCapacity : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["namePrefix"] = args ? args.namePrefix : undefined;
resourceInputs["preserveHostHeader"] = args ? args.preserveHostHeader : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["securityGroups"] = args ? args.securityGroups : undefined;
resourceInputs["subnetMappings"] = args ? args.subnetMappings : undefined;
resourceInputs["subnets"] = args ? args.subnets : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["xffHeaderProcessingMode"] = args ? args.xffHeaderProcessingMode : undefined;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["arnSuffix"] = undefined /*out*/;
resourceInputs["dnsName"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
resourceInputs["vpcId"] = undefined /*out*/;
resourceInputs["zoneId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const aliasOpts = { aliases: [{ type: "aws:elasticloadbalancingv2/loadBalancer:LoadBalancer" }] };
opts = pulumi.mergeOptions(opts, aliasOpts);
super(LoadBalancer.__pulumiType, name, resourceInputs, opts);
}
}
exports.LoadBalancer = LoadBalancer;
/** @internal */
LoadBalancer.__pulumiType = 'aws:lb/loadBalancer:LoadBalancer';
//# sourceMappingURL=loadBalancer.js.map