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