-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/aws: Add validation for aws_elb.name #2517
provider/aws: Add validation for aws_elb.name #2517
Conversation
Someday maybe we can actually do an API query to verify this. Someday. Maybe. 😀 |
LGTM |
I see your point, but the beauty of these validations is that it can all be done offline :) so to keep that benefit, we'd have to save all existing ELBs in the account somewhere otherwise I don't see the difference between asking "Create" API or "List"/"Search" api ... :-/ |
provider/aws: Add validation for aws_elb.name
Good point. Something to think on. My feeling is that it seems like we should do everything we can to catch as many potential errors in the Plan step instead of the Apply step - that would be the difference in doing a pre-Describe earlier. Of course there's always going to be a race condition. We can discuss more once we get to that layer of niceties. Someday. 👍 😀 |
@@ -25,6 +26,26 @@ func resourceAwsElb() *schema.Resource { | |||
Type: schema.TypeString, | |||
Required: true, | |||
ForceNew: true, | |||
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { | |||
value := v.(string) | |||
if !regexp.MustCompile(`^[0-9a-z-]$`).MatchString(value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@catsby I overlooked this one too... :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no worries, they're getting sorted out 😄
woops, we 've got about 12 ELBs that are |
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. |
http://docs.aws.amazon.com/cli/latest/reference/elb/create-load-balancer.html