vmware-archive / terraforming-gcp

use terraform, deploy yourself a pcf
Apache License 2.0
71 stars 87 forks source link

Error thrown if dns_suffix variable includes trailing dot #89

Closed mattysweeps closed 5 years ago

mattysweeps commented 6 years ago

The variable dns_suffix assumes the trailing dot is not included. If the dot is applied, say with the value example.com., the following error occurs:

Error: Error applying plan:
1 error(s) occurred:
* google_dns_managed_zone.env_dns_zone: 1 error(s) occurred:
* google_dns_managed_zone.env_dns_zone: Error creating DNS ManagedZone: googleapi: Error 400: Invalid value for 'entity.managedZone.dnsName': 'example.com..', invalid

Notice the ... I assumed that dns_suffix should be a true suffix to a FQDN. Once I updated from example.com. to example.com, the plan worked.

Thoughts for potential solution:

  1. The documentation should explicitly specify to not include the trailing dot (This makes the most sense to me)
  2. Usage of the dns_suffix variable should check for the trailing dot
cf-gitbot commented 6 years ago

We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.

The labels on this github issue will be updated when the story is started.

cdutra commented 5 years ago

Hi @mattysweeps, thanks for reporting this issue. We decided to update the documentation to warn users that they should not use trailing dots on dns_suffix. The reasoning behind not doing checks for trailing dots is because we use in multiple places and that will add unnecessary complexity.

cc @ciriarte

mattysweeps commented 5 years ago

Thanks @cdutra,

Sounds good to me :)