github.com/tomaszheflik/terraform@v0.7.3-0.20160827060421-32f990b41594/website/source/docs/providers/aws/r/alb.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_alb" 4 sidebar_current: "docs-aws-resource-alb" 5 description: |- 6 Provides an Application Load Balancer resource. 7 --- 8 9 # aws\_alb 10 11 Provides an Application Load Balancer resource. 12 13 ## Example Usage 14 15 ``` 16 # Create a new load balancer 17 resource "aws_alb" "test" { 18 name = "test-alb-tf" 19 internal = false 20 security_groups = ["${aws_security_group.alb_sg.id}"] 21 subnets = ["${aws_subnet.public.*.id}"] 22 23 enable_deletion_protection = true 24 25 access_logs { 26 bucket = "${aws_s3_bucket.alb_logs.bucket}" 27 prefix = "test-alb" 28 } 29 30 tags { 31 Environment = "production" 32 } 33 } 34 ``` 35 36 ## Argument Reference 37 38 The following arguments are supported: 39 40 * `name` - (Optional) The name of the ALB. By default generated by Terraform. 41 * `internal` - (Optional) If true, the ALB will be internal. 42 * `security_groups` - (Optional) A list of security group IDs to assign to the ELB. 43 * `access_logs` - (Optional) An Access Logs block. Access Logs documented below. 44 * `subnets` - (Required) A list of subnet IDs to attach to the ELB. 45 * `idle_timeout` - (Optional) The time in seconds that the connection is allowed to be idle. Default: 60. 46 * `enable_deletion_protection` - (Optional) If true, deletion of the load balancer will be disabled via 47 the AWS API. This will prevent Terraform from deleting the load balancer. 48 * `tags` - (Optional) A mapping of tags to assign to the resource. 49 50 Access Logs (`access_logs`) support the following: 51 52 * `bucket` - (Required) The S3 bucket name to store the logs in. 53 * `prefix` - (Optional) The S3 bucket prefix. Logs are stored in the root if not configured. 54 55 ## Attributes Reference 56 57 The following attributes are exported in addition to the arguments listed above: 58 59 * `id` - The ARN of the load balancer (matches `arn`) 60 * `arn` - The ARN of the load balancer (matches `id`) 61 * `dns_name` - The DNS name of the load balancer 62 * `canonical_hosted_zone_id` - The canonical hosted zone ID of the load balancer. 63 * `zone_id` - The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record) 64 65 ## Import 66 67 ALBs can be imported using their ARN, e.g. 68 69 ``` 70 $ terraform import aws_alb.bar arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188 71 ```