1. Packages
  2. AWS
  3. API Docs
  4. lb
  5. LoadBalancer
Viewing docs for AWS v5.43.0 (Older version)
published on Tuesday, Mar 10, 2026 by Pulumi
aws logo
Viewing docs for AWS v5.43.0 (Older version)
published on Tuesday, Mar 10, 2026 by Pulumi

    Provides a Load Balancer resource.

    Note: aws.alb.LoadBalancer is known as aws.lb.LoadBalancer. The functionality is identical.

    Example Usage

    Application Load Balancer

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var test = new Aws.LB.LoadBalancer("test", new()
        {
            Internal = false,
            LoadBalancerType = "application",
            SecurityGroups = new[]
            {
                aws_security_group.Lb_sg.Id,
            },
            Subnets = .Select(subnet => 
            {
                return  subnet.Id;
            }),
            EnableDeletionProtection = true,
            AccessLogs = new Aws.LB.Inputs.LoadBalancerAccessLogsArgs
            {
                Bucket = aws_s3_bucket.Lb_logs.Id,
                Prefix = "test-lb",
                Enabled = true,
            },
            Tags = 
            {
                { "Environment", "production" },
            },
        });
    
    });
    
    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, "test", &lb.LoadBalancerArgs{
    			Internal:         pulumi.Bool(false),
    			LoadBalancerType: pulumi.String("application"),
    			SecurityGroups: pulumi.StringArray{
    				aws_security_group.Lb_sg.Id,
    			},
    			Subnets:                  "TODO: For expression",
    			EnableDeletionProtection: pulumi.Bool(true),
    			AccessLogs: &lb.LoadBalancerAccessLogsArgs{
    				Bucket:  pulumi.Any(aws_s3_bucket.Lb_logs.Id),
    				Prefix:  pulumi.String("test-lb"),
    				Enabled: pulumi.Bool(true),
    			},
    			Tags: pulumi.StringMap{
    				"Environment": pulumi.String("production"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Example coming soon!

    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.id,
            prefix: "test-lb",
            enabled: true,
        },
        tags: {
            Environment: "production",
        },
    });
    
    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"]["id"],
            prefix="test-lb",
            enabled=True,
        ),
        tags={
            "Environment": "production",
        })
    

    Example coming soon!

    Network Load Balancer

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var test = new Aws.LB.LoadBalancer("test", new()
        {
            Internal = false,
            LoadBalancerType = "network",
            Subnets = .Select(subnet => 
            {
                return  subnet.Id;
            }),
            EnableDeletionProtection = true,
            Tags = 
            {
                { "Environment", "production" },
            },
        });
    
    });
    
    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, "test", &lb.LoadBalancerArgs{
    			Internal:                 pulumi.Bool(false),
    			LoadBalancerType:         pulumi.String("network"),
    			Subnets:                  "TODO: For expression",
    			EnableDeletionProtection: pulumi.Bool(true),
    			Tags: pulumi.StringMap{
    				"Environment": pulumi.String("production"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Example coming soon!

    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",
        },
    });
    
    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",
        })
    

    Example coming soon!

    Specifying Elastic IPs

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.LB.LoadBalancer("example", new()
        {
            LoadBalancerType = "network",
            SubnetMappings = new[]
            {
                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 com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.lb.LoadBalancer;
    import com.pulumi.aws.lb.LoadBalancerArgs;
    import com.pulumi.aws.lb.inputs.LoadBalancerSubnetMappingArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    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 * 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,
            },
        ],
    });
    
    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"],
            ),
        ])
    
    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 System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.LB.LoadBalancer("example", new()
        {
            LoadBalancerType = "network",
            SubnetMappings = new[]
            {
                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 com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.lb.LoadBalancer;
    import com.pulumi.aws.lb.LoadBalancerArgs;
    import com.pulumi.aws.lb.inputs.LoadBalancerSubnetMappingArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    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 * 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",
            },
        ],
    });
    
    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",
            ),
        ])
    
    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 LoadBalancer Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new LoadBalancer(name: string, args?: LoadBalancerArgs, opts?: CustomResourceOptions);
    @overload
    def LoadBalancer(resource_name: str,
                     args: Optional[LoadBalancerArgs] = None,
                     opts: Optional[ResourceOptions] = None)
    
    @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_tls_version_and_cipher_suite_headers: Optional[bool] = None,
                     enable_waf_fail_open: Optional[bool] = None,
                     enable_xff_client_port: 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,
                     preserve_host_header: Optional[bool] = None,
                     security_groups: Optional[Sequence[str]] = None,
                     subnet_mappings: Optional[Sequence[LoadBalancerSubnetMappingArgs]] = None,
                     subnets: Optional[Sequence[str]] = None,
                     tags: Optional[Mapping[str, str]] = None,
                     xff_header_processing_mode: Optional[str] = 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.
    
    

    Parameters

    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.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var exampleloadBalancerResourceResourceFromLbloadBalancer = new Aws.LB.LoadBalancer("exampleloadBalancerResourceResourceFromLbloadBalancer", new()
    {
        AccessLogs = new Aws.LB.Inputs.LoadBalancerAccessLogsArgs
        {
            Bucket = "string",
            Enabled = false,
            Prefix = "string",
        },
        CustomerOwnedIpv4Pool = "string",
        DesyncMitigationMode = "string",
        DropInvalidHeaderFields = false,
        EnableCrossZoneLoadBalancing = false,
        EnableDeletionProtection = false,
        EnableHttp2 = false,
        EnableTlsVersionAndCipherSuiteHeaders = false,
        EnableWafFailOpen = false,
        EnableXffClientPort = false,
        IdleTimeout = 0,
        Internal = false,
        IpAddressType = "string",
        LoadBalancerType = "string",
        Name = "string",
        NamePrefix = "string",
        PreserveHostHeader = false,
        SecurityGroups = new[]
        {
            "string",
        },
        SubnetMappings = new[]
        {
            new Aws.LB.Inputs.LoadBalancerSubnetMappingArgs
            {
                SubnetId = "string",
                AllocationId = "string",
                Ipv6Address = "string",
                OutpostId = "string",
                PrivateIpv4Address = "string",
            },
        },
        Subnets = new[]
        {
            "string",
        },
        Tags = 
        {
            { "string", "string" },
        },
        XffHeaderProcessingMode = "string",
    });
    
    example, err := lb.NewLoadBalancer(ctx, "exampleloadBalancerResourceResourceFromLbloadBalancer", &lb.LoadBalancerArgs{
    	AccessLogs: &lb.LoadBalancerAccessLogsArgs{
    		Bucket:  pulumi.String("string"),
    		Enabled: pulumi.Bool(false),
    		Prefix:  pulumi.String("string"),
    	},
    	CustomerOwnedIpv4Pool:                 pulumi.String("string"),
    	DesyncMitigationMode:                  pulumi.String("string"),
    	DropInvalidHeaderFields:               pulumi.Bool(false),
    	EnableCrossZoneLoadBalancing:          pulumi.Bool(false),
    	EnableDeletionProtection:              pulumi.Bool(false),
    	EnableHttp2:                           pulumi.Bool(false),
    	EnableTlsVersionAndCipherSuiteHeaders: pulumi.Bool(false),
    	EnableWafFailOpen:                     pulumi.Bool(false),
    	EnableXffClientPort:                   pulumi.Bool(false),
    	IdleTimeout:                           pulumi.Int(0),
    	Internal:                              pulumi.Bool(false),
    	IpAddressType:                         pulumi.String("string"),
    	LoadBalancerType:                      pulumi.String("string"),
    	Name:                                  pulumi.String("string"),
    	NamePrefix:                            pulumi.String("string"),
    	PreserveHostHeader:                    pulumi.Bool(false),
    	SecurityGroups: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	SubnetMappings: lb.LoadBalancerSubnetMappingArray{
    		&lb.LoadBalancerSubnetMappingArgs{
    			SubnetId:           pulumi.String("string"),
    			AllocationId:       pulumi.String("string"),
    			Ipv6Address:        pulumi.String("string"),
    			OutpostId:          pulumi.String("string"),
    			PrivateIpv4Address: pulumi.String("string"),
    		},
    	},
    	Subnets: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	XffHeaderProcessingMode: pulumi.String("string"),
    })
    
    var exampleloadBalancerResourceResourceFromLbloadBalancer = new com.pulumi.aws.lb.LoadBalancer("exampleloadBalancerResourceResourceFromLbloadBalancer", com.pulumi.aws.lb.LoadBalancerArgs.builder()
        .accessLogs(LoadBalancerAccessLogsArgs.builder()
            .bucket("string")
            .enabled(false)
            .prefix("string")
            .build())
        .customerOwnedIpv4Pool("string")
        .desyncMitigationMode("string")
        .dropInvalidHeaderFields(false)
        .enableCrossZoneLoadBalancing(false)
        .enableDeletionProtection(false)
        .enableHttp2(false)
        .enableTlsVersionAndCipherSuiteHeaders(false)
        .enableWafFailOpen(false)
        .enableXffClientPort(false)
        .idleTimeout(0)
        .internal(false)
        .ipAddressType("string")
        .loadBalancerType("string")
        .name("string")
        .namePrefix("string")
        .preserveHostHeader(false)
        .securityGroups("string")
        .subnetMappings(LoadBalancerSubnetMappingArgs.builder()
            .subnetId("string")
            .allocationId("string")
            .ipv6Address("string")
            .outpostId("string")
            .privateIpv4Address("string")
            .build())
        .subnets("string")
        .tags(Map.of("string", "string"))
        .xffHeaderProcessingMode("string")
        .build());
    
    exampleload_balancer_resource_resource_from_lbload_balancer = aws.lb.LoadBalancer("exampleloadBalancerResourceResourceFromLbloadBalancer",
        access_logs={
            "bucket": "string",
            "enabled": False,
            "prefix": "string",
        },
        customer_owned_ipv4_pool="string",
        desync_mitigation_mode="string",
        drop_invalid_header_fields=False,
        enable_cross_zone_load_balancing=False,
        enable_deletion_protection=False,
        enable_http2=False,
        enable_tls_version_and_cipher_suite_headers=False,
        enable_waf_fail_open=False,
        enable_xff_client_port=False,
        idle_timeout=0,
        internal=False,
        ip_address_type="string",
        load_balancer_type="string",
        name="string",
        name_prefix="string",
        preserve_host_header=False,
        security_groups=["string"],
        subnet_mappings=[{
            "subnet_id": "string",
            "allocation_id": "string",
            "ipv6_address": "string",
            "outpost_id": "string",
            "private_ipv4_address": "string",
        }],
        subnets=["string"],
        tags={
            "string": "string",
        },
        xff_header_processing_mode="string")
    
    const exampleloadBalancerResourceResourceFromLbloadBalancer = new aws.lb.LoadBalancer("exampleloadBalancerResourceResourceFromLbloadBalancer", {
        accessLogs: {
            bucket: "string",
            enabled: false,
            prefix: "string",
        },
        customerOwnedIpv4Pool: "string",
        desyncMitigationMode: "string",
        dropInvalidHeaderFields: false,
        enableCrossZoneLoadBalancing: false,
        enableDeletionProtection: false,
        enableHttp2: false,
        enableTlsVersionAndCipherSuiteHeaders: false,
        enableWafFailOpen: false,
        enableXffClientPort: false,
        idleTimeout: 0,
        internal: false,
        ipAddressType: "string",
        loadBalancerType: "string",
        name: "string",
        namePrefix: "string",
        preserveHostHeader: false,
        securityGroups: ["string"],
        subnetMappings: [{
            subnetId: "string",
            allocationId: "string",
            ipv6Address: "string",
            outpostId: "string",
            privateIpv4Address: "string",
        }],
        subnets: ["string"],
        tags: {
            string: "string",
        },
        xffHeaderProcessingMode: "string",
    });
    
    type: aws:lb:LoadBalancer
    properties:
        accessLogs:
            bucket: string
            enabled: false
            prefix: string
        customerOwnedIpv4Pool: string
        desyncMitigationMode: string
        dropInvalidHeaderFields: false
        enableCrossZoneLoadBalancing: false
        enableDeletionProtection: false
        enableHttp2: false
        enableTlsVersionAndCipherSuiteHeaders: false
        enableWafFailOpen: false
        enableXffClientPort: false
        idleTimeout: 0
        internal: false
        ipAddressType: string
        loadBalancerType: string
        name: string
        namePrefix: string
        preserveHostHeader: false
        securityGroups:
            - string
        subnetMappings:
            - allocationId: string
              ipv6Address: string
              outpostId: string
              privateIpv4Address: string
              subnetId: string
        subnets:
            - string
        tags:
            string: string
        xffHeaderProcessingMode: string
    

    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

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The LoadBalancer resource accepts the following input properties:

    AccessLogs LoadBalancerAccessLogs
    An Access Logs block. Access Logs documented below.
    CustomerOwnedIpv4Pool string
    The ID of the customer owned ipv4 pool to use for this load balancer.
    DesyncMitigationMode string
    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.
    DropInvalidHeaderFields bool
    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.
    EnableCrossZoneLoadBalancing bool
    If true, cross-zone load balancing of the load balancer will be enabled. For network and gateway type load balancers, this feature is disabled by default (false). For application load balancer this feature is always enabled (true) and cannot be disabled. Defaults to false.
    EnableDeletionProtection bool
    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.
    EnableHttp2 bool
    Indicates whether HTTP/2 is enabled in application load balancers. Defaults to true.
    EnableTlsVersionAndCipherSuiteHeaders bool
    Indicates whether the two headers (x-amzn-tls-version and x-amzn-tls-cipher-suite), which contain information about the negotiated TLS version and cipher suite, are added to the client request before sending it to the target. Only valid for Load Balancers of type application. Defaults to false
    EnableWafFailOpen bool
    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.
    EnableXffClientPort bool
    Indicates whether the X-Forwarded-For header should preserve the source port that the client used to connect to the load balancer in application load balancers. Defaults to false.
    IdleTimeout 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. Defaults to false.
    IpAddressType string
    The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 and dualstack.
    LoadBalancerType string
    The type of load balancer to create. Possible values are application, gateway, or network. The default value is application.
    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.
    NamePrefix string
    Creates a unique name beginning with the specified prefix. Conflicts with name.
    PreserveHostHeader bool
    Indicates whether the Application Load Balancer should preserve the Host header in the HTTP request and send it to the target without any change. Defaults to false.
    SecurityGroups List<string>
    A list of security group IDs to assign to the LB. Only valid for Load Balancers of type application.
    SubnetMappings List<LoadBalancerSubnetMapping>
    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 type network will force a recreation of the resource.
    Tags 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.
    XffHeaderProcessingMode string
    Determines how the load balancer modifies the X-Forwarded-For header in the HTTP request before sending the request to the target. The possible values are append, preserve, and remove. Only valid for Load Balancers of type application. The default is append.
    AccessLogs LoadBalancerAccessLogsArgs
    An Access Logs block. Access Logs documented below.
    CustomerOwnedIpv4Pool string
    The ID of the customer owned ipv4 pool to use for this load balancer.
    DesyncMitigationMode string
    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.
    DropInvalidHeaderFields bool
    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.
    EnableCrossZoneLoadBalancing bool
    If true, cross-zone load balancing of the load balancer will be enabled. For network and gateway type load balancers, this feature is disabled by default (false). For application load balancer this feature is always enabled (true) and cannot be disabled. Defaults to false.
    EnableDeletionProtection bool
    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.
    EnableHttp2 bool
    Indicates whether HTTP/2 is enabled in application load balancers. Defaults to true.
    EnableTlsVersionAndCipherSuiteHeaders bool
    Indicates whether the two headers (x-amzn-tls-version and x-amzn-tls-cipher-suite), which contain information about the negotiated TLS version and cipher suite, are added to the client request before sending it to the target. Only valid for Load Balancers of type application. Defaults to false
    EnableWafFailOpen bool
    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.
    EnableXffClientPort bool
    Indicates whether the X-Forwarded-For header should preserve the source port that the client used to connect to the load balancer in application load balancers. Defaults to false.
    IdleTimeout 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. Defaults to false.
    IpAddressType string
    The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 and dualstack.
    LoadBalancerType string
    The type of load balancer to create. Possible values are application, gateway, or network. The default value is application.
    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.
    NamePrefix string
    Creates a unique name beginning with the specified prefix. Conflicts with name.
    PreserveHostHeader bool
    Indicates whether the Application Load Balancer should preserve the Host header in the HTTP request and send it to the target without any change. Defaults to false.
    SecurityGroups []string
    A list of security group IDs to assign to the LB. Only valid for Load Balancers of type application.
    SubnetMappings []LoadBalancerSubnetMappingArgs
    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 type network will force a recreation of the resource.
    Tags 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.
    XffHeaderProcessingMode string
    Determines how the load balancer modifies the X-Forwarded-For header in the HTTP request before sending the request to the target. The possible values are append, preserve, and remove. Only valid for Load Balancers of type application. The default is append.
    accessLogs LoadBalancerAccessLogs
    An Access Logs block. Access Logs documented below.
    customerOwnedIpv4Pool String
    The ID of the customer owned ipv4 pool to use for this load balancer.
    desyncMitigationMode String
    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.
    dropInvalidHeaderFields Boolean
    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.
    enableCrossZoneLoadBalancing Boolean
    If true, cross-zone load balancing of the load balancer will be enabled. For network and gateway type load balancers, this feature is disabled by default (false). For application load balancer this feature is always enabled (true) and cannot be disabled. Defaults to false.
    enableDeletionProtection Boolean
    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.
    enableHttp2 Boolean
    Indicates whether HTTP/2 is enabled in application load balancers. Defaults to true.
    enableTlsVersionAndCipherSuiteHeaders Boolean
    Indicates whether the two headers (x-amzn-tls-version and x-amzn-tls-cipher-suite), which contain information about the negotiated TLS version and cipher suite, are added to the client request before sending it to the target. Only valid for Load Balancers of type application. Defaults to false
    enableWafFailOpen Boolean
    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.
    enableXffClientPort Boolean
    Indicates whether the X-Forwarded-For header should preserve the source port that the client used to connect to the load balancer in application load balancers. Defaults to false.
    idleTimeout 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. Defaults to false.
    ipAddressType String
    The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 and dualstack.
    loadBalancerType String
    The type of load balancer to create. Possible values are application, gateway, or network. The default value is application.
    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.
    namePrefix String
    Creates a unique name beginning with the specified prefix. Conflicts with name.
    preserveHostHeader Boolean
    Indicates whether the Application Load Balancer should preserve the Host header in the HTTP request and send it to the target without any change. Defaults to false.
    securityGroups List<String>
    A list of security group IDs to assign to the LB. Only valid for Load Balancers of type application.
    subnetMappings List<LoadBalancerSubnetMapping>
    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 type network will force a recreation of the resource.
    tags 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.
    xffHeaderProcessingMode String
    Determines how the load balancer modifies the X-Forwarded-For header in the HTTP request before sending the request to the target. The possible values are append, preserve, and remove. Only valid for Load Balancers of type application. The default is append.
    accessLogs LoadBalancerAccessLogs
    An Access Logs block. Access Logs documented below.
    customerOwnedIpv4Pool string
    The ID of the customer owned ipv4 pool to use for this load balancer.
    desyncMitigationMode string
    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.
    dropInvalidHeaderFields boolean
    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.
    enableCrossZoneLoadBalancing boolean
    If true, cross-zone load balancing of the load balancer will be enabled. For network and gateway type load balancers, this feature is disabled by default (false). For application load balancer this feature is always enabled (true) and cannot be disabled. Defaults to false.
    enableDeletionProtection boolean
    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.
    enableHttp2 boolean
    Indicates whether HTTP/2 is enabled in application load balancers. Defaults to true.
    enableTlsVersionAndCipherSuiteHeaders boolean
    Indicates whether the two headers (x-amzn-tls-version and x-amzn-tls-cipher-suite), which contain information about the negotiated TLS version and cipher suite, are added to the client request before sending it to the target. Only valid for Load Balancers of type application. Defaults to false
    enableWafFailOpen boolean
    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.
    enableXffClientPort boolean
    Indicates whether the X-Forwarded-For header should preserve the source port that the client used to connect to the load balancer in application load balancers. Defaults to false.
    idleTimeout 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. Defaults to false.
    ipAddressType string
    The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 and dualstack.
    loadBalancerType string
    The type of load balancer to create. Possible values are application, gateway, or network. The default value is application.
    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.
    namePrefix string
    Creates a unique name beginning with the specified prefix. Conflicts with name.
    preserveHostHeader boolean
    Indicates whether the Application Load Balancer should preserve the Host header in the HTTP request and send it to the target without any change. Defaults to false.
    securityGroups string[]
    A list of security group IDs to assign to the LB. Only valid for Load Balancers of type application.
    subnetMappings LoadBalancerSubnetMapping[]
    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 type network will force a recreation of the resource.
    tags {[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.
    xffHeaderProcessingMode string
    Determines how the load balancer modifies the X-Forwarded-For header in the HTTP request before sending the request to the target. The possible values are append, preserve, and remove. Only valid for Load Balancers of type application. The default is append.
    access_logs LoadBalancerAccessLogsArgs
    An Access Logs block. Access Logs documented below.
    customer_owned_ipv4_pool str
    The ID of the customer owned ipv4 pool to use for this load balancer.
    desync_mitigation_mode str
    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_header_fields bool
    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_zone_load_balancing bool
    If true, cross-zone load balancing of the load balancer will be enabled. For network and gateway type load balancers, this feature is disabled by default (false). For application load balancer this feature is always enabled (true) and cannot be disabled. Defaults to false.
    enable_deletion_protection bool
    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 to true.
    enable_tls_version_and_cipher_suite_headers bool
    Indicates whether the two headers (x-amzn-tls-version and x-amzn-tls-cipher-suite), which contain information about the negotiated TLS version and cipher suite, are added to the client request before sending it to the target. Only valid for Load Balancers of type application. Defaults to false
    enable_waf_fail_open bool
    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.
    enable_xff_client_port bool
    Indicates whether the X-Forwarded-For header should preserve the source port that the client used to connect to the load balancer in application load balancers. 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. Defaults to false.
    ip_address_type str
    The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 and dualstack.
    load_balancer_type str
    The type of load balancer to create. Possible values are application, gateway, or network. The default value is application.
    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.
    preserve_host_header bool
    Indicates whether the Application Load Balancer should preserve the Host header in the HTTP request and send it to the target without any change. Defaults to false.
    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[LoadBalancerSubnetMappingArgs]
    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 type network will force a recreation of the resource.
    tags 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.
    xff_header_processing_mode str
    Determines how the load balancer modifies the X-Forwarded-For header in the HTTP request before sending the request to the target. The possible values are append, preserve, and remove. Only valid for Load Balancers of type application. The default is append.
    accessLogs Property Map
    An Access Logs block. Access Logs documented below.
    customerOwnedIpv4Pool String
    The ID of the customer owned ipv4 pool to use for this load balancer.
    desyncMitigationMode String
    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.
    dropInvalidHeaderFields Boolean
    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.
    enableCrossZoneLoadBalancing Boolean
    If true, cross-zone load balancing of the load balancer will be enabled. For network and gateway type load balancers, this feature is disabled by default (false). For application load balancer this feature is always enabled (true) and cannot be disabled. Defaults to false.
    enableDeletionProtection Boolean
    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.
    enableHttp2 Boolean
    Indicates whether HTTP/2 is enabled in application load balancers. Defaults to true.
    enableTlsVersionAndCipherSuiteHeaders Boolean
    Indicates whether the two headers (x-amzn-tls-version and x-amzn-tls-cipher-suite), which contain information about the negotiated TLS version and cipher suite, are added to the client request before sending it to the target. Only valid for Load Balancers of type application. Defaults to false
    enableWafFailOpen Boolean
    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.
    enableXffClientPort Boolean
    Indicates whether the X-Forwarded-For header should preserve the source port that the client used to connect to the load balancer in application load balancers. Defaults to false.
    idleTimeout 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. Defaults to false.
    ipAddressType String
    The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 and dualstack.
    loadBalancerType String
    The type of load balancer to create. Possible values are application, gateway, or network. The default value is application.
    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.
    namePrefix String
    Creates a unique name beginning with the specified prefix. Conflicts with name.
    preserveHostHeader Boolean
    Indicates whether the Application Load Balancer should preserve the Host header in the HTTP request and send it to the target without any change. Defaults to false.
    securityGroups List<String>
    A list of security group IDs to assign to the LB. Only valid for Load Balancers of type application.
    subnetMappings 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 type network will force a recreation of the resource.
    tags 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.
    xffHeaderProcessingMode String
    Determines how the load balancer modifies the X-Forwarded-For header in the HTTP request before sending the request to the target. The possible values are append, preserve, and remove. Only valid for Load Balancers of type application. The default is append.

    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).
    ArnSuffix string
    The ARN suffix for use with CloudWatch Metrics.
    DnsName string
    The DNS name of the load balancer.
    Id string
    The provider-assigned unique ID for this managed resource.
    TagsAll Dictionary<string, string>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    VpcId string
    ZoneId string
    The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).
    Arn string
    The ARN of the load balancer (matches id).
    ArnSuffix string
    The ARN suffix for use with CloudWatch Metrics.
    DnsName string
    The DNS name of the load balancer.
    Id string
    The provider-assigned unique ID for this managed resource.
    TagsAll map[string]string
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    VpcId string
    ZoneId string
    The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).
    arn String
    The ARN of the load balancer (matches id).
    arnSuffix String
    The ARN suffix for use with CloudWatch Metrics.
    dnsName String
    The DNS name of the load balancer.
    id String
    The provider-assigned unique ID for this managed resource.
    tagsAll Map<String,String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    vpcId String
    zoneId String
    The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).
    arn string
    The ARN of the load balancer (matches id).
    arnSuffix string
    The ARN suffix for use with CloudWatch Metrics.
    dnsName string
    The DNS name of the load balancer.
    id string
    The provider-assigned unique ID for this managed resource.
    tagsAll {[key: string]: string}
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    vpcId string
    zoneId string
    The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).
    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.
    tags_all Mapping[str, str]
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    vpc_id str
    zone_id str
    The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).
    arn String
    The ARN of the load balancer (matches id).
    arnSuffix String
    The ARN suffix for use with CloudWatch Metrics.
    dnsName String
    The DNS name of the load balancer.
    id String
    The provider-assigned unique ID for this managed resource.
    tagsAll Map<String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    vpcId String
    zoneId String
    The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).

    Look up 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_tls_version_and_cipher_suite_headers: Optional[bool] = None,
            enable_waf_fail_open: Optional[bool] = None,
            enable_xff_client_port: 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,
            preserve_host_header: Optional[bool] = 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,
            xff_header_processing_mode: 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)
    resources:  _:    type: aws:lb:LoadBalancer    get:      id: ${id}
    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.
    The following state arguments are supported:
    AccessLogs LoadBalancerAccessLogs
    An Access Logs block. Access Logs documented below.
    Arn string
    The ARN of the load balancer (matches id).
    ArnSuffix string
    The ARN suffix for use with CloudWatch Metrics.
    CustomerOwnedIpv4Pool string
    The ID of the customer owned ipv4 pool to use for this load balancer.
    DesyncMitigationMode string
    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.
    DnsName string
    The DNS name of the load balancer.
    DropInvalidHeaderFields bool
    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.
    EnableCrossZoneLoadBalancing bool
    If true, cross-zone load balancing of the load balancer will be enabled. For network and gateway type load balancers, this feature is disabled by default (false). For application load balancer this feature is always enabled (true) and cannot be disabled. Defaults to false.
    EnableDeletionProtection bool
    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.
    EnableHttp2 bool
    Indicates whether HTTP/2 is enabled in application load balancers. Defaults to true.
    EnableTlsVersionAndCipherSuiteHeaders bool
    Indicates whether the two headers (x-amzn-tls-version and x-amzn-tls-cipher-suite), which contain information about the negotiated TLS version and cipher suite, are added to the client request before sending it to the target. Only valid for Load Balancers of type application. Defaults to false
    EnableWafFailOpen bool
    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.
    EnableXffClientPort bool
    Indicates whether the X-Forwarded-For header should preserve the source port that the client used to connect to the load balancer in application load balancers. Defaults to false.
    IdleTimeout 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. Defaults to false.
    IpAddressType string
    The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 and dualstack.
    LoadBalancerType string
    The type of load balancer to create. Possible values are application, gateway, or network. The default value is application.
    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.
    NamePrefix string
    Creates a unique name beginning with the specified prefix. Conflicts with name.
    PreserveHostHeader bool
    Indicates whether the Application Load Balancer should preserve the Host header in the HTTP request and send it to the target without any change. Defaults to false.
    SecurityGroups List<string>
    A list of security group IDs to assign to the LB. Only valid for Load Balancers of type application.
    SubnetMappings List<LoadBalancerSubnetMapping>
    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 type network will force a recreation of the resource.
    Tags 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.
    TagsAll Dictionary<string, string>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    VpcId string
    XffHeaderProcessingMode string
    Determines how the load balancer modifies the X-Forwarded-For header in the HTTP request before sending the request to the target. The possible values are append, preserve, and remove. Only valid for Load Balancers of type application. The default is append.
    ZoneId string
    The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).
    AccessLogs LoadBalancerAccessLogsArgs
    An Access Logs block. Access Logs documented below.
    Arn string
    The ARN of the load balancer (matches id).
    ArnSuffix string
    The ARN suffix for use with CloudWatch Metrics.
    CustomerOwnedIpv4Pool string
    The ID of the customer owned ipv4 pool to use for this load balancer.
    DesyncMitigationMode string
    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.
    DnsName string
    The DNS name of the load balancer.
    DropInvalidHeaderFields bool
    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.
    EnableCrossZoneLoadBalancing bool
    If true, cross-zone load balancing of the load balancer will be enabled. For network and gateway type load balancers, this feature is disabled by default (false). For application load balancer this feature is always enabled (true) and cannot be disabled. Defaults to false.
    EnableDeletionProtection bool
    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.
    EnableHttp2 bool
    Indicates whether HTTP/2 is enabled in application load balancers. Defaults to true.
    EnableTlsVersionAndCipherSuiteHeaders bool
    Indicates whether the two headers (x-amzn-tls-version and x-amzn-tls-cipher-suite), which contain information about the negotiated TLS version and cipher suite, are added to the client request before sending it to the target. Only valid for Load Balancers of type application. Defaults to false
    EnableWafFailOpen bool
    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.
    EnableXffClientPort bool
    Indicates whether the X-Forwarded-For header should preserve the source port that the client used to connect to the load balancer in application load balancers. Defaults to false.
    IdleTimeout 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. Defaults to false.
    IpAddressType string
    The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 and dualstack.
    LoadBalancerType string
    The type of load balancer to create. Possible values are application, gateway, or network. The default value is application.
    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.
    NamePrefix string
    Creates a unique name beginning with the specified prefix. Conflicts with name.
    PreserveHostHeader bool
    Indicates whether the Application Load Balancer should preserve the Host header in the HTTP request and send it to the target without any change. Defaults to false.
    SecurityGroups []string
    A list of security group IDs to assign to the LB. Only valid for Load Balancers of type application.
    SubnetMappings []LoadBalancerSubnetMappingArgs
    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 type network will force a recreation of the resource.
    Tags 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.
    TagsAll map[string]string
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    VpcId string
    XffHeaderProcessingMode string
    Determines how the load balancer modifies the X-Forwarded-For header in the HTTP request before sending the request to the target. The possible values are append, preserve, and remove. Only valid for Load Balancers of type application. The default is append.
    ZoneId string
    The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).
    accessLogs LoadBalancerAccessLogs
    An Access Logs block. Access Logs documented below.
    arn String
    The ARN of the load balancer (matches id).
    arnSuffix String
    The ARN suffix for use with CloudWatch Metrics.
    customerOwnedIpv4Pool String
    The ID of the customer owned ipv4 pool to use for this load balancer.
    desyncMitigationMode String
    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.
    dnsName String
    The DNS name of the load balancer.
    dropInvalidHeaderFields Boolean
    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.
    enableCrossZoneLoadBalancing Boolean
    If true, cross-zone load balancing of the load balancer will be enabled. For network and gateway type load balancers, this feature is disabled by default (false). For application load balancer this feature is always enabled (true) and cannot be disabled. Defaults to false.
    enableDeletionProtection Boolean
    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.
    enableHttp2 Boolean
    Indicates whether HTTP/2 is enabled in application load balancers. Defaults to true.
    enableTlsVersionAndCipherSuiteHeaders Boolean
    Indicates whether the two headers (x-amzn-tls-version and x-amzn-tls-cipher-suite), which contain information about the negotiated TLS version and cipher suite, are added to the client request before sending it to the target. Only valid for Load Balancers of type application. Defaults to false
    enableWafFailOpen Boolean
    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.
    enableXffClientPort Boolean
    Indicates whether the X-Forwarded-For header should preserve the source port that the client used to connect to the load balancer in application load balancers. Defaults to false.
    idleTimeout 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. Defaults to false.
    ipAddressType String
    The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 and dualstack.
    loadBalancerType String
    The type of load balancer to create. Possible values are application, gateway, or network. The default value is application.
    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.
    namePrefix String
    Creates a unique name beginning with the specified prefix. Conflicts with name.
    preserveHostHeader Boolean
    Indicates whether the Application Load Balancer should preserve the Host header in the HTTP request and send it to the target without any change. Defaults to false.
    securityGroups List<String>
    A list of security group IDs to assign to the LB. Only valid for Load Balancers of type application.
    subnetMappings List<LoadBalancerSubnetMapping>
    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 type network will force a recreation of the resource.
    tags 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.
    tagsAll Map<String,String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    vpcId String
    xffHeaderProcessingMode String
    Determines how the load balancer modifies the X-Forwarded-For header in the HTTP request before sending the request to the target. The possible values are append, preserve, and remove. Only valid for Load Balancers of type application. The default is append.
    zoneId String
    The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).
    accessLogs LoadBalancerAccessLogs
    An Access Logs block. Access Logs documented below.
    arn string
    The ARN of the load balancer (matches id).
    arnSuffix string
    The ARN suffix for use with CloudWatch Metrics.
    customerOwnedIpv4Pool string
    The ID of the customer owned ipv4 pool to use for this load balancer.
    desyncMitigationMode string
    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.
    dnsName string
    The DNS name of the load balancer.
    dropInvalidHeaderFields boolean
    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.
    enableCrossZoneLoadBalancing boolean
    If true, cross-zone load balancing of the load balancer will be enabled. For network and gateway type load balancers, this feature is disabled by default (false). For application load balancer this feature is always enabled (true) and cannot be disabled. Defaults to false.
    enableDeletionProtection boolean
    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.
    enableHttp2 boolean
    Indicates whether HTTP/2 is enabled in application load balancers. Defaults to true.
    enableTlsVersionAndCipherSuiteHeaders boolean
    Indicates whether the two headers (x-amzn-tls-version and x-amzn-tls-cipher-suite), which contain information about the negotiated TLS version and cipher suite, are added to the client request before sending it to the target. Only valid for Load Balancers of type application. Defaults to false
    enableWafFailOpen boolean
    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.
    enableXffClientPort boolean
    Indicates whether the X-Forwarded-For header should preserve the source port that the client used to connect to the load balancer in application load balancers. Defaults to false.
    idleTimeout 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. Defaults to false.
    ipAddressType string
    The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 and dualstack.
    loadBalancerType string
    The type of load balancer to create. Possible values are application, gateway, or network. The default value is application.
    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.
    namePrefix string
    Creates a unique name beginning with the specified prefix. Conflicts with name.
    preserveHostHeader boolean
    Indicates whether the Application Load Balancer should preserve the Host header in the HTTP request and send it to the target without any change. Defaults to false.
    securityGroups string[]
    A list of security group IDs to assign to the LB. Only valid for Load Balancers of type application.
    subnetMappings LoadBalancerSubnetMapping[]
    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 type network will force a recreation of the resource.
    tags {[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.
    tagsAll {[key: string]: string}
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    vpcId string
    xffHeaderProcessingMode string
    Determines how the load balancer modifies the X-Forwarded-For header in the HTTP request before sending the request to the target. The possible values are append, preserve, and remove. Only valid for Load Balancers of type application. The default is append.
    zoneId string
    The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).
    access_logs LoadBalancerAccessLogsArgs
    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_ipv4_pool str
    The ID of the customer owned ipv4 pool to use for this load balancer.
    desync_mitigation_mode str
    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_header_fields bool
    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_zone_load_balancing bool
    If true, cross-zone load balancing of the load balancer will be enabled. For network and gateway type load balancers, this feature is disabled by default (false). For application load balancer this feature is always enabled (true) and cannot be disabled. Defaults to false.
    enable_deletion_protection bool
    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 to true.
    enable_tls_version_and_cipher_suite_headers bool
    Indicates whether the two headers (x-amzn-tls-version and x-amzn-tls-cipher-suite), which contain information about the negotiated TLS version and cipher suite, are added to the client request before sending it to the target. Only valid for Load Balancers of type application. Defaults to false
    enable_waf_fail_open bool
    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.
    enable_xff_client_port bool
    Indicates whether the X-Forwarded-For header should preserve the source port that the client used to connect to the load balancer in application load balancers. 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. Defaults to false.
    ip_address_type str
    The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 and dualstack.
    load_balancer_type str
    The type of load balancer to create. Possible values are application, gateway, or network. The default value is application.
    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.
    preserve_host_header bool
    Indicates whether the Application Load Balancer should preserve the Host header in the HTTP request and send it to the target without any change. Defaults to false.
    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[LoadBalancerSubnetMappingArgs]
    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 type network will force a recreation of the resource.
    tags 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.
    tags_all Mapping[str, str]
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    vpc_id str
    xff_header_processing_mode str
    Determines how the load balancer modifies the X-Forwarded-For header in the HTTP request before sending the request to the target. The possible values are append, preserve, and remove. Only valid for Load Balancers of type application. The default is append.
    zone_id str
    The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).
    accessLogs Property Map
    An Access Logs block. Access Logs documented below.
    arn String
    The ARN of the load balancer (matches id).
    arnSuffix String
    The ARN suffix for use with CloudWatch Metrics.
    customerOwnedIpv4Pool String
    The ID of the customer owned ipv4 pool to use for this load balancer.
    desyncMitigationMode String
    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.
    dnsName String
    The DNS name of the load balancer.
    dropInvalidHeaderFields Boolean
    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.
    enableCrossZoneLoadBalancing Boolean
    If true, cross-zone load balancing of the load balancer will be enabled. For network and gateway type load balancers, this feature is disabled by default (false). For application load balancer this feature is always enabled (true) and cannot be disabled. Defaults to false.
    enableDeletionProtection Boolean
    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.
    enableHttp2 Boolean
    Indicates whether HTTP/2 is enabled in application load balancers. Defaults to true.
    enableTlsVersionAndCipherSuiteHeaders Boolean
    Indicates whether the two headers (x-amzn-tls-version and x-amzn-tls-cipher-suite), which contain information about the negotiated TLS version and cipher suite, are added to the client request before sending it to the target. Only valid for Load Balancers of type application. Defaults to false
    enableWafFailOpen Boolean
    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.
    enableXffClientPort Boolean
    Indicates whether the X-Forwarded-For header should preserve the source port that the client used to connect to the load balancer in application load balancers. Defaults to false.
    idleTimeout 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. Defaults to false.
    ipAddressType String
    The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 and dualstack.
    loadBalancerType String
    The type of load balancer to create. Possible values are application, gateway, or network. The default value is application.
    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.
    namePrefix String
    Creates a unique name beginning with the specified prefix. Conflicts with name.
    preserveHostHeader Boolean
    Indicates whether the Application Load Balancer should preserve the Host header in the HTTP request and send it to the target without any change. Defaults to false.
    securityGroups List<String>
    A list of security group IDs to assign to the LB. Only valid for Load Balancers of type application.
    subnetMappings 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 type network will force a recreation of the resource.
    tags 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.
    tagsAll Map<String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    vpcId String
    xffHeaderProcessingMode String
    Determines how the load balancer modifies the X-Forwarded-For header in the HTTP request before sending the request to the target. The possible values are append, preserve, and remove. Only valid for Load Balancers of type application. The default is append.
    zoneId String
    The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).

    Supporting Types

    LoadBalancerAccessLogs, LoadBalancerAccessLogsArgs

    Bucket string
    The S3 bucket name to store the logs in.
    Enabled bool
    Boolean to enable / disable access_logs. Defaults to false, even when bucket is specified.
    Prefix string
    The S3 bucket prefix. Logs are stored in the root if not configured.
    Bucket string
    The S3 bucket name to store the logs in.
    Enabled bool
    Boolean to enable / disable access_logs. Defaults to false, even when bucket is specified.
    Prefix string
    The S3 bucket prefix. Logs are stored in the root if not configured.
    bucket String
    The S3 bucket name to store the logs in.
    enabled Boolean
    Boolean to enable / disable access_logs. Defaults to false, even when bucket is specified.
    prefix String
    The S3 bucket prefix. Logs are stored in the root if not configured.
    bucket string
    The S3 bucket name to store the logs in.
    enabled boolean
    Boolean to enable / disable access_logs. Defaults to false, even when bucket is specified.
    prefix string
    The S3 bucket prefix. Logs are stored in the root if not configured.
    bucket str
    The S3 bucket name to store the logs in.
    enabled bool
    Boolean to enable / disable access_logs. Defaults to false, even when bucket is specified.
    prefix str
    The S3 bucket prefix. Logs are stored in the root if not configured.
    bucket String
    The S3 bucket name to store the logs in.
    enabled Boolean
    Boolean to enable / disable access_logs. Defaults to false, even when bucket is specified.
    prefix String
    The S3 bucket prefix. Logs are stored in the root if not configured.

    LoadBalancerSubnetMapping, LoadBalancerSubnetMappingArgs

    SubnetId string
    ID of the subnet of which to attach to the load balancer. You can specify only one subnet per Availability Zone.
    AllocationId string
    The allocation ID of the Elastic IP address for an internet-facing load balancer.
    Ipv6Address string
    The IPv6 address. You associate IPv6 CIDR blocks with your VPC and choose the subnets where you launch both internet-facing and internal Application Load Balancers or Network Load Balancers.
    OutpostId string
    PrivateIpv4Address string
    The private IPv4 address for an internal load balancer.
    SubnetId string
    ID of the subnet of which to attach to the load balancer. You can specify only one subnet per Availability Zone.
    AllocationId string
    The allocation ID of the Elastic IP address for an internet-facing load balancer.
    Ipv6Address string
    The IPv6 address. You associate IPv6 CIDR blocks with your VPC and choose the subnets where you launch both internet-facing and internal Application Load Balancers or Network Load Balancers.
    OutpostId string
    PrivateIpv4Address string
    The private IPv4 address for an internal load balancer.
    subnetId String
    ID of the subnet of which to attach to the load balancer. You can specify only one subnet per Availability Zone.
    allocationId String
    The allocation ID of the Elastic IP address for an internet-facing load balancer.
    ipv6Address String
    The IPv6 address. You associate IPv6 CIDR blocks with your VPC and choose the subnets where you launch both internet-facing and internal Application Load Balancers or Network Load Balancers.
    outpostId String
    privateIpv4Address String
    The private IPv4 address for an internal load balancer.
    subnetId string
    ID of the subnet of which to attach to the load balancer. You can specify only one subnet per Availability Zone.
    allocationId string
    The allocation ID of the Elastic IP address for an internet-facing load balancer.
    ipv6Address string
    The IPv6 address. You associate IPv6 CIDR blocks with your VPC and choose the subnets where you launch both internet-facing and internal Application Load Balancers or Network Load Balancers.
    outpostId string
    privateIpv4Address string
    The private IPv4 address for an internal load balancer.
    subnet_id str
    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 for an internet-facing load balancer.
    ipv6_address str
    The IPv6 address. You associate IPv6 CIDR blocks with your VPC and choose the subnets where you launch both internet-facing and internal Application Load Balancers or Network Load Balancers.
    outpost_id str
    private_ipv4_address str
    The private IPv4 address for an internal load balancer.
    subnetId String
    ID of the subnet of which to attach to the load balancer. You can specify only one subnet per Availability Zone.
    allocationId String
    The allocation ID of the Elastic IP address for an internet-facing load balancer.
    ipv6Address String
    The IPv6 address. You associate IPv6 CIDR blocks with your VPC and choose the subnets where you launch both internet-facing and internal Application Load Balancers or Network Load Balancers.
    outpostId String
    privateIpv4Address String
    The private IPv4 address for an internal 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
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    Viewing docs for AWS v5.43.0 (Older version)
    published on Tuesday, Mar 10, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.