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

Allows zero-value ELB and ALB names #14304

Merged
merged 1 commit into from
May 9, 2017

Conversation

gdavison
Copy link
Contributor

@gdavison gdavison commented May 9, 2017

The aws_alb and aws_elb resources did not allow zero-value name fields.

@grubernaut
Copy link
Contributor

Hey @gdavison, thanks for the contribution!

I'm not quite sure, however, what this PR aims to solve. The name parameter is already an Optional and Computed attribute, so if the aws_alb resource is created without the name attribute specified, one will be generated. (Same applies to the aws_elb resource).

Is there a use-case for explicitly setting the name attribute to a nil string, instead of omitting the attribute?

Thanks!

@gdavison
Copy link
Contributor Author

gdavison commented May 9, 2017

@grubernaut Sometimes when the aws_alb resource is created a generic name is ok, but other times, we may want a specific name. Allowing the zero-value field, i.e. an empty string, lets the user defer the decision or make it conditional.

variable "alb_name" {
  default = ""
}

resource "aws_alb" "sample_alb" {
  name = "${var.alb_name}"
 ...
}

This currently fails with the message "aws_alb. sample_alb: only alphanumeric characters and hyphens allowed in "name""

@gdavison
Copy link
Contributor Author

gdavison commented May 9, 2017

Also, @mitchellh's comment on #5471

Most resources at the moment must just be written to accept some "zero" value as unset. If a resource doesn't support this please report a bug.

@grubernaut
Copy link
Contributor

@gdavison, perfect, thanks!

Copy link
Contributor

@grubernaut grubernaut left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@ghost
Copy link

ghost commented Apr 12, 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 12, 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.

2 participants