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

aws/route53: Input for record.*.name != record.*.name on the output #1126

Closed
radeksimko opened this issue Mar 5, 2015 · 4 comments
Closed

Comments

@radeksimko
Copy link
Member

This is probably low-prio + easy to do, but it's more important to discuss it here.

Look at the following code and tell me what would you expect the output to be?

resource "aws_route53_zone" "primary" {
   name = "example.radeksimko.com"
}

resource "aws_route53_record" "sample" {
  zone_id = "${aws_route53_zone.primary.id}"
  name = "sample"
  type = "CNAME"
  ttl = "60"
  records = ["www.terraform.io"]
}

output "name" {
  value = "${aws_route53_record.sample.name}"
}

I would definitely expect ${aws_route53_record.sample.name} to be sample, not the full domain (sample.example.radeksimko.com).
User will most likely want to use the full domain elsewhere instead of concatenating it (so it should really stay in the output), but I'm just not sure about the name here.

How about something like aws_route53_record.sample.full_name or aws_route53_record.sample.domain or aws_route53_record.sample.fqdn?

@catsby
Copy link
Contributor

catsby commented Mar 18, 2015

This is partially the result of #969 , where we allow people to not have to use the fully qualified name. Here, name represents "DNS domain name"

Prior to #969 , you would have needed to specify the fully qualified name, so you would then also get sample.example.radeksimko.com. At least then, it wouldn't be surprise...

In theory, we could add a new computed schema element that is ignored in configuration, and is set from the name value here? Does that sound sufficient?

@catsby catsby added waiting-response An issue/pull request is waiting for a response from the community thinking labels Mar 18, 2015
@radeksimko
Copy link
Member Author

This is partially the result of #969 , where we allow people to not have to use the fully qualified name.

yeah, except it's effectively now useless as it triggers the update all the time... 😉

I do have to use the full FQDN everywhere anyway if I want consistent behaviour and not recreate the record each time I run terraform apply :)

In theory, we could add a new computed schema element that is ignored in configuration, and is set from the name value here? Does that sound sufficient?

That's basically what I meant and what I was suggesting. 👍

The whole confusion just comes from the fact that input.name != output.name - the same attribute on input may not always equal the attribute on output.

@radeksimko
Copy link
Member Author

This has been fixed in #1279

@ghost
Copy link

ghost commented May 3, 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 3, 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

3 participants