github.com/tarrant/terraform@v0.3.8-0.20150402012457-f68c9eee638e/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` - (Required for an EC2-classic ELB) The AZ's to serve traffic in.
    55  * `security_groups` - (Optional) A list of security group IDs to assign to the ELB.
    56  * `subnets` - (Required for a VPC ELB) A list of subnet IDs 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  Exactly one of `availability_zones` or `subnets` must be specified: this
    64  determines if the ELB exists in a VPC or in EC2-classic.
    65  
    66  Listeners support the following:
    67  
    68  * `instance_port` - (Required) The port on the instance to route to
    69  * `instance_protocol` - (Required) The the protocol to use to the instance.
    70  * `lb_port` - (Required) The port to listen on for the load balancer
    71  * `lb_protocol` - (Required) The protocol to listen on.
    72  * `ssl_certificate_id` - (Optional) The id of an SSL certificate you have uploaded to AWS IAM.
    73  
    74  Health Check supports the following:
    75  
    76  * `healthy_threshold` - (Required) The number of checks before the instance is declared healthy.
    77  * `unhealthy_threshold` - (Required) The number of checks before the instance is declared unhealthy.
    78  * `target` - (Required) The target of the check.
    79  * `interval` - (Required) The interval between checks.
    80  * `timeout` - (Required) The length of time before the check times out.
    81  
    82  ## Attributes Reference
    83  
    84  The following attributes are exported:
    85  
    86  * `id` - The name of the ELB
    87  * `name` - The name of the ELB
    88  * `dns_name` - The DNS name of the ELB
    89  * `instances` - The list of instances in the ELB