Merge pull request #3277 from stack72/aws-app-cookieness-doc-update

docs: Updating the app_cookie_stickiness_policy docs to reflect needing a L…
This commit is contained in:
Radek Simko 2015-10-07 17:18:55 -07:00
commit 4ca3853824
2 changed files with 22 additions and 13 deletions

View File

@ -2,6 +2,7 @@ package aws
import (
"fmt"
"regexp"
"strings"
"github.com/aws/aws-sdk-go/aws"
@ -23,6 +24,14 @@ func resourceAwsAppCookieStickinessPolicy() *schema.Resource {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: func(v interface{}, k string) (ws []string, es []error) {
value := v.(string)
if !regexp.MustCompile(`^[0-9A-Za-z-]+$`).MatchString(value) {
es = append(es, fmt.Errorf(
"only alphanumeric characters and hyphens allowed in %q", k))
}
return
},
},
"load_balancer": &schema.Schema{

View File

@ -15,20 +15,20 @@ Provides an application cookie stickiness policy, which allows an ELB to wed its
```
resource "aws_elb" "lb" {
name = "test-lb"
availability_zones = ["us-east-1a"]
listener {
instance_port = 8000
instance_protocol = "http"
lb_port = 80
lb_protocol = "http"
}
availability_zones = ["us-east-1a"]
listener {
instance_port = 8000
instance_protocol = "http"
lb_port = 80
lb_protocol = "http"
}
}
resource "aws_app_cookie_stickiness_policy" "foo" {
name = "foo_policy"
load_balancer = "${aws_elb.lb.id}"
lb_port = 80
cookie_name = "MyAppCookie"
name = "foo_policy"
load_balancer = "${aws_elb.lb.name}"
lb_port = 80
cookie_name = "MyAppCookie"
}
```
@ -37,7 +37,7 @@ resource "aws_app_cookie_stickiness_policy" "foo" {
The following arguments are supported:
* `name` - (Required) The name of the stickiness policy.
* `load_balancer` - (Required) The load balancer to which the policy
* `load_balancer` - (Required) The name of load balancer to which the policy
should be attached.
* `lb_port` - (Required) The load balancer port to which the policy
should be applied. This must be an active listener on the load
@ -50,6 +50,6 @@ The following attributes are exported:
* `id` - The ID of the policy.
* `name` - The name of the stickiness policy.
* `load_balancer` - The load balancer to which the policy is attached.
* `load_balancer` - The name of load balancer to which the policy is attached.
* `lb_port` - The load balancer port to which the policy is applied.
* `cookie_name` - The application cookie whose lifetime the ELB's cookie should follow.