Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Updating the app_cookie_stickiness_policy docs to reflect needing a L… #3277

Merged
merged 2 commits into from
Oct 8, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I tried applying this example, I got an error:

1 error(s) occurred:

* aws_app_cookie_stickiness_policy.foo: Error creating AppCookieStickinessPolicy: ValidationError: Policy name cannot contain characters that are not letters, or digits or the dash.
    status code: 400, request id: c96ca9bd-5eed-11e5-b3c8-1b09bd7b9609

It would be nice to add validation for aws_app_cookie_stickiness_policy.name, but more importantly the example should be fixed - e.g. by replacing underscore with dash.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah so this is actually an error with app_cookie_stickiness_policy?
On 19 Sep 2015 5:50 pm, "Radek Simko" notifications@github.com wrote:

In
website/source/docs/providers/aws/r/app_cookie_stickiness_policy.html.markdown
#3277 (comment):

}

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"

This is however wrong, when I tried applying this example, I got an error:

1 error(s) occurred:

  • aws_app_cookie_stickiness_policy.foo: Error creating AppCookieStickinessPolicy: ValidationError: Policy name cannot contain characters that are not letters, or digits or the dash.
    status code: 400, request id: c96ca9bd-5eed-11e5-b3c8-1b09bd7b9609

It would be nice to add validation for
aws_app_cookie_stickiness_policy.name, but more importantly the example
should be fixed - e.g. by replacing underscore with dash.


Reply to this email directly or view it on GitHub
https://github.com/hashicorp/terraform/pull/3277/files#r39921319.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, you didn't cause this by your changes 😃 but the example has invalid name for some reason, so I think we can fix it.

Copy link
Contributor Author

@stack72 stack72 Sep 19, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@radeksimko the validation rules for this are not actually noted anywhere

http://docs.aws.amazon.com/cli/latest/reference/elb/create-app-cookie-stickiness-policy.html

just says:

--policy-name (string)

The name of the policy being created. This name must be unique within the set of policies for this load balancer.

I am not sure where this error comes from. Even the go-sdk doesn't seem to list the specific error you are getting:

https://github.com/aws/aws-sdk-go/blob/master/apis/elasticloadbalancing/2012-06-01/api-2.json#L178

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, you're right, AWS docs are not always matching with the reality. I will open a support case, encourage them to update it. I've been already reporting some RDS validation, which was out of date the other day.

Until they document it, I think we should just validate against what the error says (i.e. alphanumeric + dash). Feel free to test certain edge cases, like two dashes, dashes at either end of the name, but I'd guess these will be allowed, based on the error message.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kk, will update the PR with the Validation :)

-- 
Paul
Sent with Airmail

On 19 September 2015 at 19:55:51, Radek Simko (notifications@github.com) wrote:

In website/source/docs/providers/aws/r/app_cookie_stickiness_policy.html.markdown:

}

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"
    Hm, you're right, AWS docs are not always matching with the reality. I will open a support case, encourage them to update it. I've been already reporting some RDS validation, which was out of date the other day.

Until they document it, I think we should just validate against what the error says (i.e. alphanumeric + dash). Feel free to test certain edge cases, like two dashes, dashes at either end of the name, but I'd guess these will be allowed, based on the error message.


Reply to this email directly or view it on GitHub.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: I just opened the support ticket, here's a copy: https://gist.github.com/radeksimko/f01168a61cbaa222b16c

load_balancer = "${aws_elb.lb.name}"
lb_port = 80
cookie_name = "MyAppCookie"
}
```

Expand All @@ -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
Expand All @@ -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.