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_record: Allow to create both A and AAAA record within a single resource block #18427

Open
Porkepix opened this issue Mar 26, 2021 · 3 comments
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/route53 Issues and PRs that pertain to the route53 service.

Comments

@Porkepix
Copy link

Description

Have a way to create both A and AAAA records within a single resource to not duplicate it. It's most likely nowadays that people want both A and AAAA records, the former for compatibility until IPv6 is common enough to not provide it anymore, the later to already provide future-prood conf, without having to duplicate two resource blocks where only the type will change to have A or AAAA.

New or Affected Resource(s)

  • aws_route53_record

Potential Terraform Configuration

This could be by using a fake record type translating to both of them like

resource "aws_route53_record" "www" {
  zone_id = aws_route53_zone.primary.zone_id
  name    = "example.com"
  type    = "A+AAAA"
}

or an option in the resource to create the corresponding AAAA record on a A record, something like that.

@Porkepix Porkepix added the enhancement Requests to existing resources that expand the functionality or scope. label Mar 26, 2021
@ghost ghost added the service/route53 Issues and PRs that pertain to the route53 service. label Mar 26, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Mar 26, 2021
@breathingdust breathingdust removed the needs-triage Waiting for first response or review from a maintainer. label Sep 4, 2021
@alexkusuma
Copy link

Having the capability to merge A and AAAA will make the terraform module become unnecessarily complex.
Enabling that capability will means that the module will then have to evaluate each of the values of the record parameter to check whether it's an IPv4 or IPv6 value for type = "A+AAAA" , IPv4 only for type = A, and IPv6 only for type = AAAA
The module will then also have to track whether the code have provides IPv4 as well as IPvt6 if type = A+AAAA.
What happens if the record parameters only have IPv4 values, or only IPv6 values when type = A+AAAA? Should TF throw an error assuming user made a mistake, or should TF keep going assuming that it's intentional and only creates A record if only have IPv4 values, and only AAAA records if only have IPv6 values.
Should it only support A+AAAA, or should it support A+CNAME, AAAA+CNAME, or A+AAAA+CNAME too? If only A+AAAA, then why only A+AAAA?

I think the complexity is much greater than the benefit gained.

If one is concerned that when typing the name one might made a mistake, one can use aws_route53_zone.promary.name (following the given example in the original post) to avoid making the mistake/typo.

Alternatively, can always use count and put the A or AAAA as well as their respective IP addresses in a 2-dimensional list, to achieve the similar result.

@Porkepix
Copy link
Author

What are the values you're talking about? The name parameter doesn't depends on the type. The type can already be A or AAAA, this is just asking the resource to do the same as declaring two resources blocks, one with type A and one with type AAAA.

@alexkusuma
Copy link

alexkusuma commented Feb 21, 2023

What are the values you're talking about? The name parameter doesn't depends on the type. The type can already be A or AAAA, this is just asking the resource to do the same as declaring two resources blocks, one with type A and one with type AAAA.

aws_route53_record will need you to supply either an 'alias' or 'record'. in the case of A and/or AAAA, it'll be IP addresses. If you didn't supply any values or give it a blank, then your dns won't be able to resolve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/route53 Issues and PRs that pertain to the route53 service.
Projects
None yet
Development

No branches or pull requests

3 participants