<commit_before>---
layout: "aws"
page_title: "AWS: aws_alb"
sidebar_current: "docs-aws-resource-alb"
description: |-
  Provides an Application Load Balancer resource.
---

# aws\_alb

Provides an Application Load Balancer resource.

## Example Usage

```
# Create a new load balancer
resource "aws_alb" "test" {
  name            = "test-alb-tf"
  internal        = false
  security_groups = ["${aws_security_group.alb_sg.id}"]
  subnets         = ["${aws_subnet.public.*.id}"]

  enable_deletion_protection = true

  access_logs {
    bucket = "${aws_s3_bucket.alb_logs.bucket}"
    prefix = "test-alb"
  }

  tags {
    Environment = "production"
  }
}
```

## Argument Reference

The following arguments are supported:

* `name` - (Optional) The name of the ALB. By default generated by Terraform.
* `internal` - (Optional) If true, the ALB will be internal.
* `security_groups` - (Optional) A list of security group IDs to assign to the ELB.
* `access_logs` - (Optional) An Access Logs block. Access Logs documented below.
* `subnets` - (Required) A list of subnet IDs to attach to the ELB.
* `idle_timeout` - (Optional) The time in seconds that the connection is allowed to be idle. Default: 60.
* `enable_deletion_protection` - (Optional) If true, deletion of the load balancer will be disabled via
   the AWS API. This will prevent Terraform from deleting the load balancer.
* `tags` - (Optional) A mapping of tags to assign to the resource.
<commit_msg>docs/aws: `aws_alb` name parameter is now documented as a Required field<commit_after>---
layout: "aws"
page_title: "AWS: aws_alb"
sidebar_current: "docs-aws-resource-alb"
description: |-
  Provides an Application Load Balancer resource.
---

# aws\_alb

Provides an Application Load Balancer resource.

## Example Usage

```
# Create a new load balancer
resource "aws_alb" "test" {
  name            = "test-alb-tf"
  internal        = false
  security_groups = ["${aws_security_group.alb_sg.id}"]
  subnets         = ["${aws_subnet.public.*.id}"]

  enable_deletion_protection = true

  access_logs {
    bucket = "${aws_s3_bucket.alb_logs.bucket}"
    prefix = "test-alb"
  }

  tags {
    Environment = "production"
  }
}
```

## Argument Reference

The following arguments are supported:

* `name` - (Required) The name of the ALB. 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.
* `internal` - (Optional) If true, the ALB will be internal.
* `security_groups` - (Optional) A list of security group IDs to assign to the ELB.
* `access_logs` - (Optional) An Access Logs block. Access Logs documented below.
* `subnets` - (Required) A list of subnet IDs to attach to the ELB.
* `idle_timeout` - (Optional) The time in seconds that the connection is allowed to be idle. Default: 60.
* `enable_deletion_protection` - (Optional) If true, deletion of the load balancer will be disabled via
   the AWS API. This will prevent Terraform from deleting the load balancer.
* `tags` - (Optional) A mapping of tags to assign to the resource.

{'fraction_non_alphanumeric': 0.10322786832853947, 'fraction_numerical': 0.002556727388942154, 'mean_word_length': 3.6439169139465877, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2887071', 'n_tokens_mistral': 1000, 'n_tokens_neox': 969, 'n_words': 367}