github.com/chalford/terraform@v0.3.7-0.20150113080010-a78c69a8c81f/website/source/docs/providers/aws/r/elb.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_elb" 4 sidebar_current: "docs-aws-resource-elb" 5 description: |- 6 Provides an Elastic Load Balancer resource. 7 --- 8 9 # aws\_elb 10 11 Provides an Elastic Load Balancer resource. 12 13 ## Example Usage 14 15 ``` 16 # Create a new load balancer 17 resource "aws_elb" "bar" { 18 name = "foobar-terraform-elb" 19 availability_zones = ["us-west-2a", "us-west-2b", "us-west-2c"] 20 21 listener { 22 instance_port = 8000 23 instance_protocol = "http" 24 lb_port = 80 25 lb_protocol = "http" 26 } 27 28 listener { 29 instance_port = 8000 30 instance_protocol = "http" 31 lb_port = 443 32 lb_protocol = "https" 33 ssl_certificate_id = "arn:aws:iam::123456789012:server-certificate/certName" 34 } 35 36 health_check { 37 healthy_threshold = 2 38 unhealthy_threshold = 2 39 timeout = 3 40 target = "HTTP:8000/" 41 interval = 30 42 } 43 44 instances = ["${aws_instance.foo.id}"] 45 cross_zone_load_balancing = true 46 } 47 ``` 48 49 ## Argument Reference 50 51 The following arguments are supported: 52 53 * `name` - (Required) The name of the ELB 54 * `availability_zones` - (Optional) The AZ's to serve traffic in. 55 * `security_groups` - (Optional) A list of security group IDs to assign to the ELB. 56 * `subnets` - (Optional) A list of subnets to attach to the ELB. 57 * `instances` - (Optional) A list of instance ids to place in the ELB pool. 58 * `internal` - (Optional) If true, ELB will be an internal ELB. 59 * `listener` - (Required) A list of listener blocks. Listeners documented below. 60 * `health_check` - (Optional) A health_check block. Health Check documented below. 61 * `cross_zone_load_balancing` - (Optional) Enable cross-zone load balancing. 62 63 Listeners support the following: 64 65 * `instance_port` - (Required) The port on the instance to route to 66 * `instance_protocol` - (Required) The the protocol to use to the instance. 67 * `lb_port` - (Required) The port to listen on for the load balancer 68 * `lb_protocol` - (Required) The protocol to listen on. 69 * `ssl_certificate_id` - (Optional) The id of an SSL certificate you have uploaded to AWS IAM. 70 71 Health Check supports the following: 72 73 * `healthy_threshold` - (Required) The number of checks before the instance is declared healthy. 74 * `unhealthy_threshold` - (Required) The number of checks before the instance is declared unhealthy. 75 * `target` - (Required) The target of the check. 76 * `interval` - (Required) The interval between checks. 77 * `timeout` - (Required) The length of time before the check times out. 78 79 ## Attributes Reference 80 81 The following attributes are exported: 82 83 * `id` - The name of the ELB 84 * `name` - The name of the ELB 85 * `dns_name` - The DNS name of the ELB 86 * `instances` - The list of instances in the ELB