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

Conversation

stack72
Copy link
Contributor

@stack72 stack72 commented Sep 18, 2015

…oadBalancer name NOT Id

Fixes #2926

@stack72 stack72 changed the title Updating the app_cookie_stickiness_policy docs to reflect needing a L… [DOCS] Updating the app_cookie_stickiness_policy docs to reflect needing a L… Sep 18, 2015
@radeksimko
Copy link
Member

Name and ID are actually equal, so it does not matter, but it's nice to be explicit in docs. 👍

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

@stack72
Copy link
Contributor Author

stack72 commented Sep 19, 2015

@radeksimko this is now working as expected - i was able to reproduce this with the acceptance tests. I will open a subsequent PR to add a func that allows an acceptance test for throwing the correct validation errors :)

@stack72 stack72 changed the title [DOCS] Updating the app_cookie_stickiness_policy docs to reflect needing a L… Updating the app_cookie_stickiness_policy docs to reflect needing a L… Sep 19, 2015
@stack72 stack72 changed the title Updating the app_cookie_stickiness_policy docs to reflect needing a L… docs: Updating the app_cookie_stickiness_policy docs to reflect needing a L… Sep 28, 2015
@radeksimko
Copy link
Member

Thank you for your patience here, @stack72

This LGTM now 👍

radeksimko added a commit that referenced this pull request Oct 8, 2015
docs: Updating the app_cookie_stickiness_policy docs to reflect needing a L…
@radeksimko radeksimko merged commit 4ca3853 into hashicorp:master Oct 8, 2015
@stack72 stack72 deleted the aws-app-cookieness-doc-update branch October 8, 2015 08:40
@ghost
Copy link

ghost commented Apr 30, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect documentation for aws_app_cookie_stickiness_policy - elb.id doesn't exist
2 participants