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

allow aws_route53_record to use zone_name instead of zone_id #9590

Closed
flypenguin opened this issue Oct 25, 2016 · 5 comments
Closed

allow aws_route53_record to use zone_name instead of zone_id #9590

flypenguin opened this issue Oct 25, 2016 · 5 comments

Comments

@flypenguin
Copy link

The AWS interface seems to require only one of either the zone NAME or the zone ID to create a record (see here)

It would be nice if the AWS resource would have the same choice. I imagine something like described below under "Terraform configuration files"

Terraform Version

up to 0.7.7

Affected Resource(s)

  • aws_route53_record

Terraform Configuration Files

# this works
resource "aws_route53_record" "jump" {
  name    = "jump.my-domain.com"
  zone_id = "ABCDEF123"
  type    = "CNAME"
  ttl     = "600"
  records = ["${aws_eip.my_eip.public_ip}"]
}

# this would be nice
resource "aws_route53_record" "jump" {
  name      = "jump.my-domain.com"
  zone_name = "my-domain.com"
  type      = "CNAME"
  ttl       = "600"
  records   = ["${aws_eip.my_eip.public_ip}"]
}
@kwilczynski
Copy link
Contributor

@flypenguin hi there!

This is a good idea, but a bit tricky to implement. It would require us to list all the hosted zones and then filter out these matching the particular name which would possibly return both the public and private zone IDs should the hosted zone have the same name (which is valid in Route53; and you can have multiple private hosted zones with the same domain name). In other words, it might fail should multiple hosted zones have the same name. Might not be the most ideal behaviour.

I would suggest a data source which allows one to query for a Route53 resources, plus apply filters like e.g. domain name, type (public or private), has a VPC ID assigned, etc. It would then return details about a matching hosted zone where one of them would be the hosted zone ID that could be passed down to the aws_route53_record resource.

Would that be something of interest to you?

@flypenguin
Copy link
Author

sure, basically I want to be able to just use the zone name to set things up.

but I think AWS does all that for you, because the API allows for you to use just the zone name, not the zone ID. (at least that's how I understand the descriptions)

@kwilczynski
Copy link
Contributor

kwilczynski commented Oct 25, 2016

@flypenguin hi there again. I had a look at http://docs.aws.amazon.com/sdk-for-go/api/service/route53/ and I could not find a way to pass the zone name only.

CloudFormation, which is what you liked to, most certainly implements this in a bespoke way that is specific to its internal workings, the API (which is what we use via an official SDK), does not have such functionality, unfortunately.

@flypenguin
Copy link
Author

oh, I thought CF would just pass through to the API.
Anyway, the data source would be super fine with me!

@ghost
Copy link

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