AWS Classic
LoadBalancer
Provides a Load Balancer resource.
Note:
aws.alb.LoadBalancer
is known asaws.lb.LoadBalancer
. The functionality is identical.
Example Usage
Application Load Balancer
Coming soon!
Coming soon!
Coming soon!
import pulumi
import pulumi_aws as aws
test = aws.lb.LoadBalancer("test",
internal=False,
load_balancer_type="application",
security_groups=[aws_security_group["lb_sg"]["id"]],
subnets=[subnet["id"] for subnet in aws_subnet["public"]],
enable_deletion_protection=True,
access_logs=aws.lb.LoadBalancerAccessLogsArgs(
bucket=aws_s3_bucket["lb_logs"]["bucket"],
prefix="test-lb",
enabled=True,
),
tags={
"Environment": "production",
})
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = new aws.lb.LoadBalancer("test", {
internal: false,
loadBalancerType: "application",
securityGroups: [aws_security_group.lb_sg.id],
subnets: .map(subnet => subnet.id),
enableDeletionProtection: true,
accessLogs: {
bucket: aws_s3_bucket.lb_logs.bucket,
prefix: "test-lb",
enabled: true,
},
tags: {
Environment: "production",
},
});
Coming soon!
Network Load Balancer
Coming soon!
Coming soon!
Coming soon!
import pulumi
import pulumi_aws as aws
test = aws.lb.LoadBalancer("test",
internal=False,
load_balancer_type="network",
subnets=[subnet["id"] for subnet in aws_subnet["public"]],
enable_deletion_protection=True,
tags={
"Environment": "production",
})
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = new aws.lb.LoadBalancer("test", {
internal: false,
loadBalancerType: "network",
subnets: .map(subnet => subnet.id),
enableDeletionProtection: true,
tags: {
Environment: "production",
},
});
Coming soon!
Specifying Elastic IPs
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = new Aws.LB.LoadBalancer("example", new Aws.LB.LoadBalancerArgs
{
LoadBalancerType = "network",
SubnetMappings =
{
new Aws.LB.Inputs.LoadBalancerSubnetMappingArgs
{
SubnetId = aws_subnet.Example1.Id,
AllocationId = aws_eip.Example1.Id,
},
new Aws.LB.Inputs.LoadBalancerSubnetMappingArgs
{
SubnetId = aws_subnet.Example2.Id,
AllocationId = aws_eip.Example2.Id,
},
},
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/lb"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := lb.NewLoadBalancer(ctx, "example", &lb.LoadBalancerArgs{
LoadBalancerType: pulumi.String("network"),
SubnetMappings: lb.LoadBalancerSubnetMappingArray{
&lb.LoadBalancerSubnetMappingArgs{
SubnetId: pulumi.Any(aws_subnet.Example1.Id),
AllocationId: pulumi.Any(aws_eip.Example1.Id),
},
&lb.LoadBalancerSubnetMappingArgs{
SubnetId: pulumi.Any(aws_subnet.Example2.Id),
AllocationId: pulumi.Any(aws_eip.Example2.Id),
},
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new LoadBalancer("example", LoadBalancerArgs.builder()
.loadBalancerType("network")
.subnetMappings(
LoadBalancerSubnetMappingArgs.builder()
.subnetId(aws_subnet.example1().id())
.allocationId(aws_eip.example1().id())
.build(),
LoadBalancerSubnetMappingArgs.builder()
.subnetId(aws_subnet.example2().id())
.allocationId(aws_eip.example2().id())
.build())
.build());
}
}
import pulumi
import pulumi_aws as aws
example = aws.lb.LoadBalancer("example",
load_balancer_type="network",
subnet_mappings=[
aws.lb.LoadBalancerSubnetMappingArgs(
subnet_id=aws_subnet["example1"]["id"],
allocation_id=aws_eip["example1"]["id"],
),
aws.lb.LoadBalancerSubnetMappingArgs(
subnet_id=aws_subnet["example2"]["id"],
allocation_id=aws_eip["example2"]["id"],
),
])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.lb.LoadBalancer("example", {
loadBalancerType: "network",
subnetMappings: [
{
subnetId: aws_subnet.example1.id,
allocationId: aws_eip.example1.id,
},
{
subnetId: aws_subnet.example2.id,
allocationId: aws_eip.example2.id,
},
],
});
resources:
example:
type: aws:lb:LoadBalancer
properties:
loadBalancerType: network
subnetMappings:
- subnetId: ${aws_subnet.example1.id}
allocationId: ${aws_eip.example1.id}
- subnetId: ${aws_subnet.example2.id}
allocationId: ${aws_eip.example2.id}
Specifying private IP addresses for an internal-facing load balancer
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = new Aws.LB.LoadBalancer("example", new Aws.LB.LoadBalancerArgs
{
LoadBalancerType = "network",
SubnetMappings =
{
new Aws.LB.Inputs.LoadBalancerSubnetMappingArgs
{
SubnetId = aws_subnet.Example1.Id,
PrivateIpv4Address = "10.0.1.15",
},
new Aws.LB.Inputs.LoadBalancerSubnetMappingArgs
{
SubnetId = aws_subnet.Example2.Id,
PrivateIpv4Address = "10.0.2.15",
},
},
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/lb"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := lb.NewLoadBalancer(ctx, "example", &lb.LoadBalancerArgs{
LoadBalancerType: pulumi.String("network"),
SubnetMappings: lb.LoadBalancerSubnetMappingArray{
&lb.LoadBalancerSubnetMappingArgs{
SubnetId: pulumi.Any(aws_subnet.Example1.Id),
PrivateIpv4Address: pulumi.String("10.0.1.15"),
},
&lb.LoadBalancerSubnetMappingArgs{
SubnetId: pulumi.Any(aws_subnet.Example2.Id),
PrivateIpv4Address: pulumi.String("10.0.2.15"),
},
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new LoadBalancer("example", LoadBalancerArgs.builder()
.loadBalancerType("network")
.subnetMappings(
LoadBalancerSubnetMappingArgs.builder()
.subnetId(aws_subnet.example1().id())
.privateIpv4Address("10.0.1.15")
.build(),
LoadBalancerSubnetMappingArgs.builder()
.subnetId(aws_subnet.example2().id())
.privateIpv4Address("10.0.2.15")
.build())
.build());
}
}
import pulumi
import pulumi_aws as aws
example = aws.lb.LoadBalancer("example",
load_balancer_type="network",
subnet_mappings=[
aws.lb.LoadBalancerSubnetMappingArgs(
subnet_id=aws_subnet["example1"]["id"],
private_ipv4_address="10.0.1.15",
),
aws.lb.LoadBalancerSubnetMappingArgs(
subnet_id=aws_subnet["example2"]["id"],
private_ipv4_address="10.0.2.15",
),
])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.lb.LoadBalancer("example", {
loadBalancerType: "network",
subnetMappings: [
{
subnetId: aws_subnet.example1.id,
privateIpv4Address: "10.0.1.15",
},
{
subnetId: aws_subnet.example2.id,
privateIpv4Address: "10.0.2.15",
},
],
});
resources:
example:
type: aws:lb:LoadBalancer
properties:
loadBalancerType: network
subnetMappings:
- subnetId: ${aws_subnet.example1.id}
privateIpv4Address: 10.0.1.15
- subnetId: ${aws_subnet.example2.id}
privateIpv4Address: 10.0.2.15
Create a LoadBalancer Resource
new LoadBalancer(name: string, args?: LoadBalancerArgs, opts?: CustomResourceOptions);
@overload
def LoadBalancer(resource_name: str,
opts: Optional[ResourceOptions] = None,
access_logs: Optional[LoadBalancerAccessLogsArgs] = None,
customer_owned_ipv4_pool: Optional[str] = None,
desync_mitigation_mode: Optional[str] = None,
drop_invalid_header_fields: Optional[bool] = None,
enable_cross_zone_load_balancing: Optional[bool] = None,
enable_deletion_protection: Optional[bool] = None,
enable_http2: Optional[bool] = None,
enable_waf_fail_open: Optional[bool] = None,
idle_timeout: Optional[int] = None,
internal: Optional[bool] = None,
ip_address_type: Optional[str] = None,
load_balancer_type: Optional[str] = None,
name: Optional[str] = None,
name_prefix: Optional[str] = None,
security_groups: Optional[Sequence[str]] = None,
subnet_mappings: Optional[Sequence[LoadBalancerSubnetMappingArgs]] = None,
subnets: Optional[Sequence[str]] = None,
tags: Optional[Mapping[str, str]] = None)
@overload
def LoadBalancer(resource_name: str,
args: Optional[LoadBalancerArgs] = None,
opts: Optional[ResourceOptions] = None)
func NewLoadBalancer(ctx *Context, name string, args *LoadBalancerArgs, opts ...ResourceOption) (*LoadBalancer, error)
public LoadBalancer(string name, LoadBalancerArgs? args = null, CustomResourceOptions? opts = null)
public LoadBalancer(String name, LoadBalancerArgs args)
public LoadBalancer(String name, LoadBalancerArgs args, CustomResourceOptions options)
type: aws:lb:LoadBalancer
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args LoadBalancerArgs
- 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 LoadBalancerArgs
- 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 LoadBalancerArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args LoadBalancerArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args LoadBalancerArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
LoadBalancer Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The LoadBalancer resource accepts the following input properties:
- Access
Logs LoadBalancer Access Logs Args An Access Logs block. Access Logs documented below.
- Customer
Owned stringIpv4Pool The ID of the customer owned ipv4 pool to use for this load balancer.
- Desync
Mitigation stringMode Determines how the load balancer handles requests that might pose a security risk to an application due to HTTP desync. Valid values are
monitor
,defensive
(default),strictest
.- Drop
Invalid boolHeader Fields Indicates whether HTTP headers with header fields that are not valid are removed by the load balancer (true) or routed to targets (false). The default is false. Elastic Load Balancing requires that message header names contain only alphanumeric characters and hyphens. Only valid for Load Balancers of type
application
.- Enable
Cross boolZone Load Balancing If true, cross-zone load balancing of the load balancer will be enabled. This is a
network
load balancer feature. Defaults tofalse
.- Enable
Deletion boolProtection If true, deletion of the load balancer will be disabled via the AWS API. This will prevent this provider from deleting the load balancer. Defaults to
false
.- Enable
Http2 bool Indicates whether HTTP/2 is enabled in
application
load balancers. Defaults totrue
.- Enable
Waf boolFail Open Indicates whether to allow a WAF-enabled load balancer to route requests to targets if it is unable to forward the request to AWS WAF. Defaults to
false
.- Idle
Timeout int The time in seconds that the connection is allowed to be idle. Only valid for Load Balancers of type
application
. Default: 60.- Internal bool
If true, the LB will be internal.
- Ip
Address stringType The type of IP addresses used by the subnets for your load balancer. The possible values are
ipv4
anddualstack
- Load
Balancer stringType The type of load balancer to create. Possible values are
application
,gateway
, ornetwork
. The default value isapplication
.- Name string
The name of the LB. This name must be unique within your AWS account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen. If not specified, this provider will autogenerate a name beginning with
tf-lb
.- Name
Prefix string Creates a unique name beginning with the specified prefix. Conflicts with
name
.- Security
Groups List<string> A list of security group IDs to assign to the LB. Only valid for Load Balancers of type
application
.- Subnet
Mappings List<LoadBalancer Subnet Mapping Args> A subnet mapping block as documented below.
- Subnets List<string>
A list of subnet IDs to attach to the LB. Subnets cannot be updated for Load Balancers of type
network
. Changing this value for load balancers of typenetwork
will force a recreation of the resource.- Dictionary<string, string>
A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- Access
Logs LoadBalancer Access Logs Args An Access Logs block. Access Logs documented below.
- Customer
Owned stringIpv4Pool The ID of the customer owned ipv4 pool to use for this load balancer.
- Desync
Mitigation stringMode Determines how the load balancer handles requests that might pose a security risk to an application due to HTTP desync. Valid values are
monitor
,defensive
(default),strictest
.- Drop
Invalid boolHeader Fields Indicates whether HTTP headers with header fields that are not valid are removed by the load balancer (true) or routed to targets (false). The default is false. Elastic Load Balancing requires that message header names contain only alphanumeric characters and hyphens. Only valid for Load Balancers of type
application
.- Enable
Cross boolZone Load Balancing If true, cross-zone load balancing of the load balancer will be enabled. This is a
network
load balancer feature. Defaults tofalse
.- Enable
Deletion boolProtection If true, deletion of the load balancer will be disabled via the AWS API. This will prevent this provider from deleting the load balancer. Defaults to
false
.- Enable
Http2 bool Indicates whether HTTP/2 is enabled in
application
load balancers. Defaults totrue
.- Enable
Waf boolFail Open Indicates whether to allow a WAF-enabled load balancer to route requests to targets if it is unable to forward the request to AWS WAF. Defaults to
false
.- Idle
Timeout int The time in seconds that the connection is allowed to be idle. Only valid for Load Balancers of type
application
. Default: 60.- Internal bool
If true, the LB will be internal.
- Ip
Address stringType The type of IP addresses used by the subnets for your load balancer. The possible values are
ipv4
anddualstack
- Load
Balancer stringType The type of load balancer to create. Possible values are
application
,gateway
, ornetwork
. The default value isapplication
.- Name string
The name of the LB. This name must be unique within your AWS account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen. If not specified, this provider will autogenerate a name beginning with
tf-lb
.- Name
Prefix string Creates a unique name beginning with the specified prefix. Conflicts with
name
.- Security
Groups []string A list of security group IDs to assign to the LB. Only valid for Load Balancers of type
application
.- Subnet
Mappings []LoadBalancer Subnet Mapping Args A subnet mapping block as documented below.
- Subnets []string
A list of subnet IDs to attach to the LB. Subnets cannot be updated for Load Balancers of type
network
. Changing this value for load balancers of typenetwork
will force a recreation of the resource.- map[string]string
A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- access
Logs LoadBalancer Access Logs Args An Access Logs block. Access Logs documented below.
- customer
Owned StringIpv4Pool The ID of the customer owned ipv4 pool to use for this load balancer.
- desync
Mitigation StringMode Determines how the load balancer handles requests that might pose a security risk to an application due to HTTP desync. Valid values are
monitor
,defensive
(default),strictest
.- drop
Invalid BooleanHeader Fields Indicates whether HTTP headers with header fields that are not valid are removed by the load balancer (true) or routed to targets (false). The default is false. Elastic Load Balancing requires that message header names contain only alphanumeric characters and hyphens. Only valid for Load Balancers of type
application
.- enable
Cross BooleanZone Load Balancing If true, cross-zone load balancing of the load balancer will be enabled. This is a
network
load balancer feature. Defaults tofalse
.- enable
Deletion BooleanProtection If true, deletion of the load balancer will be disabled via the AWS API. This will prevent this provider from deleting the load balancer. Defaults to
false
.- enable
Http2 Boolean Indicates whether HTTP/2 is enabled in
application
load balancers. Defaults totrue
.- enable
Waf BooleanFail Open Indicates whether to allow a WAF-enabled load balancer to route requests to targets if it is unable to forward the request to AWS WAF. Defaults to
false
.- idle
Timeout Integer The time in seconds that the connection is allowed to be idle. Only valid for Load Balancers of type
application
. Default: 60.- internal Boolean
If true, the LB will be internal.
- ip
Address StringType The type of IP addresses used by the subnets for your load balancer. The possible values are
ipv4
anddualstack
- load
Balancer StringType The type of load balancer to create. Possible values are
application
,gateway
, ornetwork
. The default value isapplication
.- name String
The name of the LB. This name must be unique within your AWS account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen. If not specified, this provider will autogenerate a name beginning with
tf-lb
.- name
Prefix String Creates a unique name beginning with the specified prefix. Conflicts with
name
.- security
Groups List<String> A list of security group IDs to assign to the LB. Only valid for Load Balancers of type
application
.- subnet
Mappings List<LoadBalancer Subnet Mapping Args> A subnet mapping block as documented below.
- subnets List<String>
A list of subnet IDs to attach to the LB. Subnets cannot be updated for Load Balancers of type
network
. Changing this value for load balancers of typenetwork
will force a recreation of the resource.- Map<String,String>
A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- access
Logs LoadBalancer Access Logs Args An Access Logs block. Access Logs documented below.
- customer
Owned stringIpv4Pool The ID of the customer owned ipv4 pool to use for this load balancer.
- desync
Mitigation stringMode Determines how the load balancer handles requests that might pose a security risk to an application due to HTTP desync. Valid values are
monitor
,defensive
(default),strictest
.- drop
Invalid booleanHeader Fields Indicates whether HTTP headers with header fields that are not valid are removed by the load balancer (true) or routed to targets (false). The default is false. Elastic Load Balancing requires that message header names contain only alphanumeric characters and hyphens. Only valid for Load Balancers of type
application
.- enable
Cross booleanZone Load Balancing If true, cross-zone load balancing of the load balancer will be enabled. This is a
network
load balancer feature. Defaults tofalse
.- enable
Deletion booleanProtection If true, deletion of the load balancer will be disabled via the AWS API. This will prevent this provider from deleting the load balancer. Defaults to
false
.- enable
Http2 boolean Indicates whether HTTP/2 is enabled in
application
load balancers. Defaults totrue
.- enable
Waf booleanFail Open Indicates whether to allow a WAF-enabled load balancer to route requests to targets if it is unable to forward the request to AWS WAF. Defaults to
false
.- idle
Timeout number The time in seconds that the connection is allowed to be idle. Only valid for Load Balancers of type
application
. Default: 60.- internal boolean
If true, the LB will be internal.
- ip
Address stringType The type of IP addresses used by the subnets for your load balancer. The possible values are
ipv4
anddualstack
- load
Balancer stringType The type of load balancer to create. Possible values are
application
,gateway
, ornetwork
. The default value isapplication
.- name string
The name of the LB. This name must be unique within your AWS account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen. If not specified, this provider will autogenerate a name beginning with
tf-lb
.- name
Prefix string Creates a unique name beginning with the specified prefix. Conflicts with
name
.- security
Groups string[] A list of security group IDs to assign to the LB. Only valid for Load Balancers of type
application
.- subnet
Mappings LoadBalancer Subnet Mapping Args[] A subnet mapping block as documented below.
- subnets string[]
A list of subnet IDs to attach to the LB. Subnets cannot be updated for Load Balancers of type
network
. Changing this value for load balancers of typenetwork
will force a recreation of the resource.- {[key: string]: string}
A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- access_
logs LoadBalancer Access Logs Args An Access Logs block. Access Logs documented below.
- customer_
owned_ stripv4_ pool The ID of the customer owned ipv4 pool to use for this load balancer.
- desync_
mitigation_ strmode Determines how the load balancer handles requests that might pose a security risk to an application due to HTTP desync. Valid values are
monitor
,defensive
(default),strictest
.- drop_
invalid_ boolheader_ fields Indicates whether HTTP headers with header fields that are not valid are removed by the load balancer (true) or routed to targets (false). The default is false. Elastic Load Balancing requires that message header names contain only alphanumeric characters and hyphens. Only valid for Load Balancers of type
application
.- enable_
cross_ boolzone_ load_ balancing If true, cross-zone load balancing of the load balancer will be enabled. This is a
network
load balancer feature. Defaults tofalse
.- enable_
deletion_ boolprotection If true, deletion of the load balancer will be disabled via the AWS API. This will prevent this provider from deleting the load balancer. Defaults to
false
.- enable_
http2 bool Indicates whether HTTP/2 is enabled in
application
load balancers. Defaults totrue
.- enable_
waf_ boolfail_ open Indicates whether to allow a WAF-enabled load balancer to route requests to targets if it is unable to forward the request to AWS WAF. Defaults to
false
.- idle_
timeout int The time in seconds that the connection is allowed to be idle. Only valid for Load Balancers of type
application
. Default: 60.- internal bool
If true, the LB will be internal.
- ip_
address_ strtype The type of IP addresses used by the subnets for your load balancer. The possible values are
ipv4
anddualstack
- load_
balancer_ strtype The type of load balancer to create. Possible values are
application
,gateway
, ornetwork
. The default value isapplication
.- name str
The name of the LB. This name must be unique within your AWS account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen. If not specified, this provider will autogenerate a name beginning with
tf-lb
.- name_
prefix str Creates a unique name beginning with the specified prefix. Conflicts with
name
.- security_
groups Sequence[str] A list of security group IDs to assign to the LB. Only valid for Load Balancers of type
application
.- subnet_
mappings Sequence[LoadBalancer Subnet Mapping Args] A subnet mapping block as documented below.
- subnets Sequence[str]
A list of subnet IDs to attach to the LB. Subnets cannot be updated for Load Balancers of type
network
. Changing this value for load balancers of typenetwork
will force a recreation of the resource.- Mapping[str, str]
A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- access
Logs Property Map An Access Logs block. Access Logs documented below.
- customer
Owned StringIpv4Pool The ID of the customer owned ipv4 pool to use for this load balancer.
- desync
Mitigation StringMode Determines how the load balancer handles requests that might pose a security risk to an application due to HTTP desync. Valid values are
monitor
,defensive
(default),strictest
.- drop
Invalid BooleanHeader Fields Indicates whether HTTP headers with header fields that are not valid are removed by the load balancer (true) or routed to targets (false). The default is false. Elastic Load Balancing requires that message header names contain only alphanumeric characters and hyphens. Only valid for Load Balancers of type
application
.- enable
Cross BooleanZone Load Balancing If true, cross-zone load balancing of the load balancer will be enabled. This is a
network
load balancer feature. Defaults tofalse
.- enable
Deletion BooleanProtection If true, deletion of the load balancer will be disabled via the AWS API. This will prevent this provider from deleting the load balancer. Defaults to
false
.- enable
Http2 Boolean Indicates whether HTTP/2 is enabled in
application
load balancers. Defaults totrue
.- enable
Waf BooleanFail Open Indicates whether to allow a WAF-enabled load balancer to route requests to targets if it is unable to forward the request to AWS WAF. Defaults to
false
.- idle
Timeout Number The time in seconds that the connection is allowed to be idle. Only valid for Load Balancers of type
application
. Default: 60.- internal Boolean
If true, the LB will be internal.
- ip
Address StringType The type of IP addresses used by the subnets for your load balancer. The possible values are
ipv4
anddualstack
- load
Balancer StringType The type of load balancer to create. Possible values are
application
,gateway
, ornetwork
. The default value isapplication
.- name String
The name of the LB. This name must be unique within your AWS account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen. If not specified, this provider will autogenerate a name beginning with
tf-lb
.- name
Prefix String Creates a unique name beginning with the specified prefix. Conflicts with
name
.- security
Groups List<String> A list of security group IDs to assign to the LB. Only valid for Load Balancers of type
application
.- subnet
Mappings List<Property Map> A subnet mapping block as documented below.
- subnets List<String>
A list of subnet IDs to attach to the LB. Subnets cannot be updated for Load Balancers of type
network
. Changing this value for load balancers of typenetwork
will force a recreation of the resource.- Map<String>
A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Outputs
All input properties are implicitly available as output properties. Additionally, the LoadBalancer resource produces the following output properties:
- Arn string
The ARN of the load balancer (matches
id
).- Arn
Suffix string The ARN suffix for use with CloudWatch Metrics.
- Dns
Name string The DNS name of the load balancer.
- Id string
The provider-assigned unique ID for this managed resource.
- Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider .
- Vpc
Id string - Zone
Id string The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).
subnet_mapping.*.outpost_id
- ID of the Outpost containing the load balancer.
- Arn string
The ARN of the load balancer (matches
id
).- Arn
Suffix string The ARN suffix for use with CloudWatch Metrics.
- Dns
Name string The DNS name of the load balancer.
- Id string
The provider-assigned unique ID for this managed resource.
- map[string]string
A map of tags assigned to the resource, including those inherited from the provider .
- Vpc
Id string - Zone
Id string The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).
subnet_mapping.*.outpost_id
- ID of the Outpost containing the load balancer.
- arn String
The ARN of the load balancer (matches
id
).- arn
Suffix String The ARN suffix for use with CloudWatch Metrics.
- dns
Name String The DNS name of the load balancer.
- id String
The provider-assigned unique ID for this managed resource.
- Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider .
- vpc
Id String - zone
Id String The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).
subnet_mapping.*.outpost_id
- ID of the Outpost containing the load balancer.
- arn string
The ARN of the load balancer (matches
id
).- arn
Suffix string The ARN suffix for use with CloudWatch Metrics.
- dns
Name string The DNS name of the load balancer.
- id string
The provider-assigned unique ID for this managed resource.
- {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider .
- vpc
Id string - zone
Id string The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).
subnet_mapping.*.outpost_id
- ID of the Outpost containing the load balancer.
- arn str
The ARN of the load balancer (matches
id
).- arn_
suffix str The ARN suffix for use with CloudWatch Metrics.
- dns_
name str The DNS name of the load balancer.
- id str
The provider-assigned unique ID for this managed resource.
- Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider .
- vpc_
id str - zone_
id str The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).
subnet_mapping.*.outpost_id
- ID of the Outpost containing the load balancer.
- arn String
The ARN of the load balancer (matches
id
).- arn
Suffix String The ARN suffix for use with CloudWatch Metrics.
- dns
Name String The DNS name of the load balancer.
- id String
The provider-assigned unique ID for this managed resource.
- Map<String>
A map of tags assigned to the resource, including those inherited from the provider .
- vpc
Id String - zone
Id String The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).
subnet_mapping.*.outpost_id
- ID of the Outpost containing the load balancer.
Look up an Existing LoadBalancer Resource
Get an existing LoadBalancer 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?: LoadBalancerState, opts?: CustomResourceOptions): LoadBalancer
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
access_logs: Optional[LoadBalancerAccessLogsArgs] = None,
arn: Optional[str] = None,
arn_suffix: Optional[str] = None,
customer_owned_ipv4_pool: Optional[str] = None,
desync_mitigation_mode: Optional[str] = None,
dns_name: Optional[str] = None,
drop_invalid_header_fields: Optional[bool] = None,
enable_cross_zone_load_balancing: Optional[bool] = None,
enable_deletion_protection: Optional[bool] = None,
enable_http2: Optional[bool] = None,
enable_waf_fail_open: Optional[bool] = None,
idle_timeout: Optional[int] = None,
internal: Optional[bool] = None,
ip_address_type: Optional[str] = None,
load_balancer_type: Optional[str] = None,
name: Optional[str] = None,
name_prefix: Optional[str] = None,
security_groups: Optional[Sequence[str]] = None,
subnet_mappings: Optional[Sequence[LoadBalancerSubnetMappingArgs]] = None,
subnets: Optional[Sequence[str]] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None,
vpc_id: Optional[str] = None,
zone_id: Optional[str] = None) -> LoadBalancer
func GetLoadBalancer(ctx *Context, name string, id IDInput, state *LoadBalancerState, opts ...ResourceOption) (*LoadBalancer, error)
public static LoadBalancer Get(string name, Input<string> id, LoadBalancerState? state, CustomResourceOptions? opts = null)
public static LoadBalancer get(String name, Output<String> id, LoadBalancerState 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.
- Access
Logs LoadBalancer Access Logs Args An Access Logs block. Access Logs documented below.
- Arn string
The ARN of the load balancer (matches
id
).- Arn
Suffix string The ARN suffix for use with CloudWatch Metrics.
- Customer
Owned stringIpv4Pool The ID of the customer owned ipv4 pool to use for this load balancer.
- Desync
Mitigation stringMode Determines how the load balancer handles requests that might pose a security risk to an application due to HTTP desync. Valid values are
monitor
,defensive
(default),strictest
.- Dns
Name string The DNS name of the load balancer.
- Drop
Invalid boolHeader Fields Indicates whether HTTP headers with header fields that are not valid are removed by the load balancer (true) or routed to targets (false). The default is false. Elastic Load Balancing requires that message header names contain only alphanumeric characters and hyphens. Only valid for Load Balancers of type
application
.- Enable
Cross boolZone Load Balancing If true, cross-zone load balancing of the load balancer will be enabled. This is a
network
load balancer feature. Defaults tofalse
.- Enable
Deletion boolProtection If true, deletion of the load balancer will be disabled via the AWS API. This will prevent this provider from deleting the load balancer. Defaults to
false
.- Enable
Http2 bool Indicates whether HTTP/2 is enabled in
application
load balancers. Defaults totrue
.- Enable
Waf boolFail Open Indicates whether to allow a WAF-enabled load balancer to route requests to targets if it is unable to forward the request to AWS WAF. Defaults to
false
.- Idle
Timeout int The time in seconds that the connection is allowed to be idle. Only valid for Load Balancers of type
application
. Default: 60.- Internal bool
If true, the LB will be internal.
- Ip
Address stringType The type of IP addresses used by the subnets for your load balancer. The possible values are
ipv4
anddualstack
- Load
Balancer stringType The type of load balancer to create. Possible values are
application
,gateway
, ornetwork
. The default value isapplication
.- Name string
The name of the LB. This name must be unique within your AWS account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen. If not specified, this provider will autogenerate a name beginning with
tf-lb
.- Name
Prefix string Creates a unique name beginning with the specified prefix. Conflicts with
name
.- Security
Groups List<string> A list of security group IDs to assign to the LB. Only valid for Load Balancers of type
application
.- Subnet
Mappings List<LoadBalancer Subnet Mapping Args> A subnet mapping block as documented below.
- Subnets List<string>
A list of subnet IDs to attach to the LB. Subnets cannot be updated for Load Balancers of type
network
. Changing this value for load balancers of typenetwork
will force a recreation of the resource.- Dictionary<string, string>
A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider .
- Vpc
Id string - Zone
Id string The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).
subnet_mapping.*.outpost_id
- ID of the Outpost containing the load balancer.
- Access
Logs LoadBalancer Access Logs Args An Access Logs block. Access Logs documented below.
- Arn string
The ARN of the load balancer (matches
id
).- Arn
Suffix string The ARN suffix for use with CloudWatch Metrics.
- Customer
Owned stringIpv4Pool The ID of the customer owned ipv4 pool to use for this load balancer.
- Desync
Mitigation stringMode Determines how the load balancer handles requests that might pose a security risk to an application due to HTTP desync. Valid values are
monitor
,defensive
(default),strictest
.- Dns
Name string The DNS name of the load balancer.
- Drop
Invalid boolHeader Fields Indicates whether HTTP headers with header fields that are not valid are removed by the load balancer (true) or routed to targets (false). The default is false. Elastic Load Balancing requires that message header names contain only alphanumeric characters and hyphens. Only valid for Load Balancers of type
application
.- Enable
Cross boolZone Load Balancing If true, cross-zone load balancing of the load balancer will be enabled. This is a
network
load balancer feature. Defaults tofalse
.- Enable
Deletion boolProtection If true, deletion of the load balancer will be disabled via the AWS API. This will prevent this provider from deleting the load balancer. Defaults to
false
.- Enable
Http2 bool Indicates whether HTTP/2 is enabled in
application
load balancers. Defaults totrue
.- Enable
Waf boolFail Open Indicates whether to allow a WAF-enabled load balancer to route requests to targets if it is unable to forward the request to AWS WAF. Defaults to
false
.- Idle
Timeout int The time in seconds that the connection is allowed to be idle. Only valid for Load Balancers of type
application
. Default: 60.- Internal bool
If true, the LB will be internal.
- Ip
Address stringType The type of IP addresses used by the subnets for your load balancer. The possible values are
ipv4
anddualstack
- Load
Balancer stringType The type of load balancer to create. Possible values are
application
,gateway
, ornetwork
. The default value isapplication
.- Name string
The name of the LB. This name must be unique within your AWS account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen. If not specified, this provider will autogenerate a name beginning with
tf-lb
.- Name
Prefix string Creates a unique name beginning with the specified prefix. Conflicts with
name
.- Security
Groups []string A list of security group IDs to assign to the LB. Only valid for Load Balancers of type
application
.- Subnet
Mappings []LoadBalancer Subnet Mapping Args A subnet mapping block as documented below.
- Subnets []string
A list of subnet IDs to attach to the LB. Subnets cannot be updated for Load Balancers of type
network
. Changing this value for load balancers of typenetwork
will force a recreation of the resource.- map[string]string
A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- map[string]string
A map of tags assigned to the resource, including those inherited from the provider .
- Vpc
Id string - Zone
Id string The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).
subnet_mapping.*.outpost_id
- ID of the Outpost containing the load balancer.
- access
Logs LoadBalancer Access Logs Args An Access Logs block. Access Logs documented below.
- arn String
The ARN of the load balancer (matches
id
).- arn
Suffix String The ARN suffix for use with CloudWatch Metrics.
- customer
Owned StringIpv4Pool The ID of the customer owned ipv4 pool to use for this load balancer.
- desync
Mitigation StringMode Determines how the load balancer handles requests that might pose a security risk to an application due to HTTP desync. Valid values are
monitor
,defensive
(default),strictest
.- dns
Name String The DNS name of the load balancer.
- drop
Invalid BooleanHeader Fields Indicates whether HTTP headers with header fields that are not valid are removed by the load balancer (true) or routed to targets (false). The default is false. Elastic Load Balancing requires that message header names contain only alphanumeric characters and hyphens. Only valid for Load Balancers of type
application
.- enable
Cross BooleanZone Load Balancing If true, cross-zone load balancing of the load balancer will be enabled. This is a
network
load balancer feature. Defaults tofalse
.- enable
Deletion BooleanProtection If true, deletion of the load balancer will be disabled via the AWS API. This will prevent this provider from deleting the load balancer. Defaults to
false
.- enable
Http2 Boolean Indicates whether HTTP/2 is enabled in
application
load balancers. Defaults totrue
.- enable
Waf BooleanFail Open Indicates whether to allow a WAF-enabled load balancer to route requests to targets if it is unable to forward the request to AWS WAF. Defaults to
false
.- idle
Timeout Integer The time in seconds that the connection is allowed to be idle. Only valid for Load Balancers of type
application
. Default: 60.- internal Boolean
If true, the LB will be internal.
- ip
Address StringType The type of IP addresses used by the subnets for your load balancer. The possible values are
ipv4
anddualstack
- load
Balancer StringType The type of load balancer to create. Possible values are
application
,gateway
, ornetwork
. The default value isapplication
.- name String
The name of the LB. This name must be unique within your AWS account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen. If not specified, this provider will autogenerate a name beginning with
tf-lb
.- name
Prefix String Creates a unique name beginning with the specified prefix. Conflicts with
name
.- security
Groups List<String> A list of security group IDs to assign to the LB. Only valid for Load Balancers of type
application
.- subnet
Mappings List<LoadBalancer Subnet Mapping Args> A subnet mapping block as documented below.
- subnets List<String>
A list of subnet IDs to attach to the LB. Subnets cannot be updated for Load Balancers of type
network
. Changing this value for load balancers of typenetwork
will force a recreation of the resource.- Map<String,String>
A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider .
- vpc
Id String - zone
Id String The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).
subnet_mapping.*.outpost_id
- ID of the Outpost containing the load balancer.
- access
Logs LoadBalancer Access Logs Args An Access Logs block. Access Logs documented below.
- arn string
The ARN of the load balancer (matches
id
).- arn
Suffix string The ARN suffix for use with CloudWatch Metrics.
- customer
Owned stringIpv4Pool The ID of the customer owned ipv4 pool to use for this load balancer.
- desync
Mitigation stringMode Determines how the load balancer handles requests that might pose a security risk to an application due to HTTP desync. Valid values are
monitor
,defensive
(default),strictest
.- dns
Name string The DNS name of the load balancer.
- drop
Invalid booleanHeader Fields Indicates whether HTTP headers with header fields that are not valid are removed by the load balancer (true) or routed to targets (false). The default is false. Elastic Load Balancing requires that message header names contain only alphanumeric characters and hyphens. Only valid for Load Balancers of type
application
.- enable
Cross booleanZone Load Balancing If true, cross-zone load balancing of the load balancer will be enabled. This is a
network
load balancer feature. Defaults tofalse
.- enable
Deletion booleanProtection If true, deletion of the load balancer will be disabled via the AWS API. This will prevent this provider from deleting the load balancer. Defaults to
false
.- enable
Http2 boolean Indicates whether HTTP/2 is enabled in
application
load balancers. Defaults totrue
.- enable
Waf booleanFail Open Indicates whether to allow a WAF-enabled load balancer to route requests to targets if it is unable to forward the request to AWS WAF. Defaults to
false
.- idle
Timeout number The time in seconds that the connection is allowed to be idle. Only valid for Load Balancers of type
application
. Default: 60.- internal boolean
If true, the LB will be internal.
- ip
Address stringType The type of IP addresses used by the subnets for your load balancer. The possible values are
ipv4
anddualstack
- load
Balancer stringType The type of load balancer to create. Possible values are
application
,gateway
, ornetwork
. The default value isapplication
.- name string
The name of the LB. This name must be unique within your AWS account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen. If not specified, this provider will autogenerate a name beginning with
tf-lb
.- name
Prefix string Creates a unique name beginning with the specified prefix. Conflicts with
name
.- security
Groups string[] A list of security group IDs to assign to the LB. Only valid for Load Balancers of type
application
.- subnet
Mappings LoadBalancer Subnet Mapping Args[] A subnet mapping block as documented below.
- subnets string[]
A list of subnet IDs to attach to the LB. Subnets cannot be updated for Load Balancers of type
network
. Changing this value for load balancers of typenetwork
will force a recreation of the resource.- {[key: string]: string}
A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider .
- vpc
Id string - zone
Id string The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).
subnet_mapping.*.outpost_id
- ID of the Outpost containing the load balancer.
- access_
logs LoadBalancer Access Logs Args An Access Logs block. Access Logs documented below.
- arn str
The ARN of the load balancer (matches
id
).- arn_
suffix str The ARN suffix for use with CloudWatch Metrics.
- customer_
owned_ stripv4_ pool The ID of the customer owned ipv4 pool to use for this load balancer.
- desync_
mitigation_ strmode Determines how the load balancer handles requests that might pose a security risk to an application due to HTTP desync. Valid values are
monitor
,defensive
(default),strictest
.- dns_
name str The DNS name of the load balancer.
- drop_
invalid_ boolheader_ fields Indicates whether HTTP headers with header fields that are not valid are removed by the load balancer (true) or routed to targets (false). The default is false. Elastic Load Balancing requires that message header names contain only alphanumeric characters and hyphens. Only valid for Load Balancers of type
application
.- enable_
cross_ boolzone_ load_ balancing If true, cross-zone load balancing of the load balancer will be enabled. This is a
network
load balancer feature. Defaults tofalse
.- enable_
deletion_ boolprotection If true, deletion of the load balancer will be disabled via the AWS API. This will prevent this provider from deleting the load balancer. Defaults to
false
.- enable_
http2 bool Indicates whether HTTP/2 is enabled in
application
load balancers. Defaults totrue
.- enable_
waf_ boolfail_ open Indicates whether to allow a WAF-enabled load balancer to route requests to targets if it is unable to forward the request to AWS WAF. Defaults to
false
.- idle_
timeout int The time in seconds that the connection is allowed to be idle. Only valid for Load Balancers of type
application
. Default: 60.- internal bool
If true, the LB will be internal.
- ip_
address_ strtype The type of IP addresses used by the subnets for your load balancer. The possible values are
ipv4
anddualstack
- load_
balancer_ strtype The type of load balancer to create. Possible values are
application
,gateway
, ornetwork
. The default value isapplication
.- name str
The name of the LB. This name must be unique within your AWS account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen. If not specified, this provider will autogenerate a name beginning with
tf-lb
.- name_
prefix str Creates a unique name beginning with the specified prefix. Conflicts with
name
.- security_
groups Sequence[str] A list of security group IDs to assign to the LB. Only valid for Load Balancers of type
application
.- subnet_
mappings Sequence[LoadBalancer Subnet Mapping Args] A subnet mapping block as documented below.
- subnets Sequence[str]
A list of subnet IDs to attach to the LB. Subnets cannot be updated for Load Balancers of type
network
. Changing this value for load balancers of typenetwork
will force a recreation of the resource.- Mapping[str, str]
A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider .
- vpc_
id str - zone_
id str The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).
subnet_mapping.*.outpost_id
- ID of the Outpost containing the load balancer.
- access
Logs Property Map An Access Logs block. Access Logs documented below.
- arn String
The ARN of the load balancer (matches
id
).- arn
Suffix String The ARN suffix for use with CloudWatch Metrics.
- customer
Owned StringIpv4Pool The ID of the customer owned ipv4 pool to use for this load balancer.
- desync
Mitigation StringMode Determines how the load balancer handles requests that might pose a security risk to an application due to HTTP desync. Valid values are
monitor
,defensive
(default),strictest
.- dns
Name String The DNS name of the load balancer.
- drop
Invalid BooleanHeader Fields Indicates whether HTTP headers with header fields that are not valid are removed by the load balancer (true) or routed to targets (false). The default is false. Elastic Load Balancing requires that message header names contain only alphanumeric characters and hyphens. Only valid for Load Balancers of type
application
.- enable
Cross BooleanZone Load Balancing If true, cross-zone load balancing of the load balancer will be enabled. This is a
network
load balancer feature. Defaults tofalse
.- enable
Deletion BooleanProtection If true, deletion of the load balancer will be disabled via the AWS API. This will prevent this provider from deleting the load balancer. Defaults to
false
.- enable
Http2 Boolean Indicates whether HTTP/2 is enabled in
application
load balancers. Defaults totrue
.- enable
Waf BooleanFail Open Indicates whether to allow a WAF-enabled load balancer to route requests to targets if it is unable to forward the request to AWS WAF. Defaults to
false
.- idle
Timeout Number The time in seconds that the connection is allowed to be idle. Only valid for Load Balancers of type
application
. Default: 60.- internal Boolean
If true, the LB will be internal.
- ip
Address StringType The type of IP addresses used by the subnets for your load balancer. The possible values are
ipv4
anddualstack
- load
Balancer StringType The type of load balancer to create. Possible values are
application
,gateway
, ornetwork
. The default value isapplication
.- name String
The name of the LB. This name must be unique within your AWS account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen. If not specified, this provider will autogenerate a name beginning with
tf-lb
.- name
Prefix String Creates a unique name beginning with the specified prefix. Conflicts with
name
.- security
Groups List<String> A list of security group IDs to assign to the LB. Only valid for Load Balancers of type
application
.- subnet
Mappings List<Property Map> A subnet mapping block as documented below.
- subnets List<String>
A list of subnet IDs to attach to the LB. Subnets cannot be updated for Load Balancers of type
network
. Changing this value for load balancers of typenetwork
will force a recreation of the resource.- Map<String>
A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Map<String>
A map of tags assigned to the resource, including those inherited from the provider .
- vpc
Id String - zone
Id String The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).
subnet_mapping.*.outpost_id
- ID of the Outpost containing the load balancer.
Supporting Types
LoadBalancerAccessLogs
LoadBalancerSubnetMapping
- Subnet
Id string The id of the subnet of which to attach to the load balancer. You can specify only one subnet per Availability Zone.
- Allocation
Id string The allocation ID of the Elastic IP address.
- Ipv6Address string
An ipv6 address within the subnet to assign to the internet-facing load balancer.
- Outpost
Id string - Private
Ipv4Address string A private ipv4 address within the subnet to assign to the internal-facing load balancer.
- Subnet
Id string The id of the subnet of which to attach to the load balancer. You can specify only one subnet per Availability Zone.
- Allocation
Id string The allocation ID of the Elastic IP address.
- Ipv6Address string
An ipv6 address within the subnet to assign to the internet-facing load balancer.
- Outpost
Id string - Private
Ipv4Address string A private ipv4 address within the subnet to assign to the internal-facing load balancer.
- subnet
Id String The id of the subnet of which to attach to the load balancer. You can specify only one subnet per Availability Zone.
- allocation
Id String The allocation ID of the Elastic IP address.
- ipv6Address String
An ipv6 address within the subnet to assign to the internet-facing load balancer.
- outpost
Id String - private
Ipv4Address String A private ipv4 address within the subnet to assign to the internal-facing load balancer.
- subnet
Id string The id of the subnet of which to attach to the load balancer. You can specify only one subnet per Availability Zone.
- allocation
Id string The allocation ID of the Elastic IP address.
- ipv6Address string
An ipv6 address within the subnet to assign to the internet-facing load balancer.
- outpost
Id string - private
Ipv4Address string A private ipv4 address within the subnet to assign to the internal-facing load balancer.
- subnet_
id str The id of the subnet of which to attach to the load balancer. You can specify only one subnet per Availability Zone.
- allocation_
id str The allocation ID of the Elastic IP address.
- ipv6_
address str An ipv6 address within the subnet to assign to the internet-facing load balancer.
- outpost_
id str - private_
ipv4_ straddress A private ipv4 address within the subnet to assign to the internal-facing load balancer.
- subnet
Id String The id of the subnet of which to attach to the load balancer. You can specify only one subnet per Availability Zone.
- allocation
Id String The allocation ID of the Elastic IP address.
- ipv6Address String
An ipv6 address within the subnet to assign to the internet-facing load balancer.
- outpost
Id String - private
Ipv4Address String A private ipv4 address within the subnet to assign to the internal-facing load balancer.
Import
LBs can be imported using their ARN, e.g.,
$ pulumi import aws:lb/loadBalancer:LoadBalancer bar arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
aws
Terraform Provider.