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

Automatically suffix zone name on record names (AWS) #312

Closed
delitescere opened this issue Sep 19, 2014 · 6 comments
Closed

Automatically suffix zone name on record names (AWS) #312

delitescere opened this issue Sep 19, 2014 · 6 comments

Comments

@delitescere
Copy link

The name property in aws_route53_record resources should not have to be fully qualified by the user.

If the value of the name property does not already end with the name property of the associated zone, then that zone name should be automatically suffixed.

resource "aws_route53_zone" "main" {
  name = "example.com"
}

resource "aws_route53_record" "www" {
  zone_id = "${aws_route53_zone.main.zone_id}"
  ttl = "60"
# the following should be able to be specified simply as "www"
  name = "www.example.com"
  type = "A" 
  records = ["${aws_instance.www.public_ip}"]
}
@clstokes
Copy link
Contributor

I've gotten around this by referencing the aws_route53_zone resource, but would prefer to not even have to do this.

resource "aws_route53_zone" "main" {
  name = "example.com"
}

resource "aws_route53_record" "www" {
  zone_id = "${aws_route53_zone.main.zone_id}"
  ttl = "60"
  name = "www.${aws_route53_zone.main.name}"     # <---- reference the aws_route53_zone
  type = "A" 
  records = ["${aws_instance.www.public_ip}"]
}

@delitescere
Copy link
Author

Agreed. I ended up doing same.

@catsby
Copy link
Contributor

catsby commented Feb 12, 2015

Hey @clstokes and @delitescere – #969 should fix this, and was just merged, will go out in the next release.

Thanks for reporting.

@catsby catsby closed this as completed Feb 12, 2015
@delitescere
Copy link
Author

Awesome thanks @catsby 👍

@clstokes
Copy link
Contributor

@catsby 😍 :shipit:

@ghost
Copy link

ghost commented May 4, 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 May 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants