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

Resource aws_vpc_dhcp_options should trim trailing . from domain_name #7800

Closed
rlees85 opened this issue Mar 4, 2019 · 5 comments · Fixed by #14220
Closed

Resource aws_vpc_dhcp_options should trim trailing . from domain_name #7800

rlees85 opened this issue Mar 4, 2019 · 5 comments · Fixed by #14220
Assignees
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service.
Milestone

Comments

@rlees85
Copy link

rlees85 commented Mar 4, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

  • Terraform v0.11.7
  • AWS Provider 2.0.0

Affected Resource(s)

  • aws_vpc_dhcp_options

Terraform Configuration Files

resource "aws_vpc_dhcp_options" "scope" {
  domain_name         =   "${coalesce(join("", aws_route53_zone.private.*.name), format("%v.%v", data.aws_region.scope.name, var.dhcp_options_domain_fallback_suffix))}"
  domain_name_servers = [ "${var.dhcp_options_dns_servers                                                                                                             }" ]

  tags {
    VPC    = "${var.name                                                                                                                                }"
    Name   = "${var.name}-${var.dhcp_options_name                                                                                                       }"
    Owner  = "${var.owner                                                                                                                               }"
    Domain = "${coalesce(join("", aws_route53_zone.private.*.name), format("%v.%v", data.aws_region.scope.name,var.dhcp_options_domain_fallback_suffix))}"
    Region = "${data.aws_region.scope.name                                                                                                              }"
  }
}

Debug Output

n/a

Panic Output

n/a

Expected Behavior

The output of the route53_zone name to be accepted into the domain_name for DHCP options.

Actual Behavior

There is now a trailing dot, that the DHCP option set resource accepts but breaks all DHCP clients.

Similar:
#6535
#6389

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@bflad bflad added the service/ec2 Issues and PRs that pertain to the ec2 service. label Mar 4, 2019
@aeschright aeschright added the needs-triage Waiting for first response or review from a maintainer. label Jun 24, 2019
@jeffery
Copy link

jeffery commented Jun 29, 2019

Hi @rlees85 Did you manage to get a workaround for the manipulation of the end dot in the var.dhcp_options_dns_servers list?

@rlees85
Copy link
Author

rlees85 commented Jun 29, 2019

Its domain_name I had issues with, I was trying to use the output of route53_zone directly in this field. For now I am using something like:

replace(join("", aws_route53_zone.private.*.name), "/\\.$/", "")

With is a simple regex that removes any . if and only if it is at the end of the string.

@aeschright aeschright added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Nov 23, 2019
@bflad bflad added this to the v3.0.0 milestone Jul 7, 2020
@anGie44
Copy link
Contributor

anGie44 commented Jul 23, 2020

Hi @rlees85, thanks again for creating this issue! With the proposed changes in #14220 to remove the trailing period in Route53 Zone resources, resources like aws_vpc_dhcp_options should behave as expected when using the name attribute of the aws_route53_zone resource as input to domain_name. The bug-fix will land in the upcoming Provider release of v3.0.0 😃

@ghost
Copy link

ghost commented Jul 31, 2020

This has been released in version 3.0.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Aug 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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Aug 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
5 participants