Skip to main content
Providers

LoadBalancer

A resource of the AWS provider, version 0.3.0, in its Load Balancing group. Import it with:

import LoadBalancer from "aws/loadbalancing"

Example

resource LoadBalancer example {
    name                   = "example-value"
    type                   = "application"
    scheme                 = "internet-facing"
    subnets                = "..."
    securityGroups         = "..."
    ipAddressType          = "ipv4"
    deletionProtection     = false
    crossZoneLoadBalancing = true
    enableHttp2            = true
    idleTimeout            = 60
    accessLogsEnabled      = false
    accessLogsBucket       = "example-value"
    accessLogsPrefix       = "example-value"
    tags                   = "..."
}

Properties

Set by your code in the resource block. A required one must be set; any other you leave out takes the value under Default, if it has one.

NameTypeDefaultRequiredDescription
namestring—NoThe name of the load balancer. Must be unique within your AWS account
typestring"application"NoThe type of load balancer Allowed: "application", "network", "gateway"
schemestring"internet-facing"NoThe scheme for the load balancer Allowed: "internet-facing", "internal"
subnetsany[]—NoThe subnet IDs. At least two in different Availability Zones
securityGroupsany[]—NoThe security group IDs. Required for ALB, not applicable for NLB
ipAddressTypestring"ipv4"NoThe IP address type Allowed: "ipv4", "dualstack"
deletionProtectionbooleanfalseNoEnable deletion protection
crossZoneLoadBalancingboolean—NoEnable cross-zone load balancing
enableHttp2booleantrueNoEnable HTTP/2 support (ALB only)
idleTimeoutnumber60NoIdle timeout in seconds (ALB only)
accessLogsEnabledbooleanfalseNoEnable access logs
accessLogsBucketstring—NoS3 bucket for access logs
accessLogsPrefixstring—NoS3 bucket prefix for access logs
tagsobject—NoTags to apply to the load balancer

Set by AWS after the resource is created: your code can read them but not set them. An importable one identifies an existing resource.

NameTypeImportableDescription
arnstringYesThe Amazon Resource Name (ARN) of the load balancer
dnsNamestringNoThe DNS name of the load balancer
canonicalHostedZoneIdstringNoThe canonical hosted zone ID of the load balancer
vpcIdstringNoThe VPC ID of the load balancer
statestringNoThe current state of the load balancer
availabilityZonesany[]NoThe Availability Zones for the load balancer

On this page