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

Add CNAME resolution tree (CNAME recursivity) to the dns_cname_record… #389

Conversation

hightoxicity
Copy link

…_set datasource

It is actually hard to achieve recursivity with Terraform.
If at some time we want to follow a CNAME tree in Terraform it is near impossible to do it dynamically and find final leaf.

This feature would allow to get a CNAME full path to final leaf CNAME and allow to use those intermediate found elements to do some ops, here in Docusign, we need to know if one of those intermediate element cross a host that has "akadns.net." suffix (akamai global traffic management property) to add some controls to our Terraform GTM Automation.

I put one of our record to test, but we need to get a similar fixture record under hashicorptest.com and adapt the test for this.

Thx for your help/review/feedback

@hightoxicity hightoxicity requested a review from a team as a code owner December 15, 2023 10:56
@hashicorp-cla
Copy link

hashicorp-cla commented Dec 15, 2023

CLA assistant check
All committers have signed the CLA.

@hightoxicity hightoxicity force-pushed the feat-add-cname-tree-resolution-to-dns-cname-record-set-ds branch from 8120f5e to 87cebe5 Compare December 15, 2023 13:31
@hightoxicity hightoxicity changed the title Add CNAME tree resolution (CNAME recursivity) to the dns_cname_record… Add CNAME resolution tree (CNAME recursivity) to the dns_cname_record… Dec 15, 2023
@hightoxicity hightoxicity force-pushed the feat-add-cname-tree-resolution-to-dns-cname-record-set-ds branch from 87cebe5 to bed642e Compare December 15, 2023 13:37
@bflad
Copy link
Contributor

bflad commented Dec 15, 2023

Hi @hightoxicity 👋 Thank you for submitting this. Interesting use case -- would you be able to open a feature request that describes the "why" of this a little better please? e.g.

  • Your DNS record structure (it sounds like potentially CNAME -> CNAME -> A/AAAA)
  • Why traversing it is necessary from a DNS record perspective (over using other information, such as managed resources that would be directly causing the intermediate records to be exist)
  • What is not possible or easy in your Terraform configuration today (psuedo-config is okay)
  • What the updated configuration with this enhancement will make possible

From a design perspective, another thing I'd like to poke at is whether it is more or less confusing to have a resource that does both a single lookup (cname attribute) and recursive lookup (cname_tree attribute), versus offering a separate resource that is intentionally setup for recursive lookups. Practitioners/environments may not be expecting this behavior by default. It is likely okay to bake it into the existing resource, but there might be other considerations, such as potential configurations or implementation details necessary to limit recursion should there be cyclical resource records and other edge cases that recursion introduces.

In the meantime, if anyone else is interested in this use case, please 👍 on the original PR description which can help us with prioritization.

@hightoxicity
Copy link
Author

hightoxicity commented Dec 16, 2023

Hi @hightoxicity 👋 Thank you for submitting this. Interesting use case -- would you be able to open a feature request that describes the "why" of this a little better please? e.g.

  • Your DNS record structure (it sounds like potentially CNAME -> CNAME -> A/AAAA)
  • Why traversing it is necessary from a DNS record perspective (over using other information, such as managed resources that would be directly causing the intermediate records to be exist)
  • What is not possible or easy in your Terraform configuration today (psuedo-config is okay)
  • What the updated configuration with this enhancement will make possible

From a design perspective, another thing I'd like to poke at is whether it is more or less confusing to have a resource that does both a single lookup (cname attribute) and recursive lookup (cname_tree attribute), versus offering a separate resource that is intentionally setup for recursive lookups. Practitioners/environments may not be expecting this behavior by default. It is likely okay to bake it into the existing resource, but there might be other considerations, such as potential configurations or implementation details necessary to limit recursion should there be cyclical resource records and other edge cases that recursion introduces.

In the meantime, if anyone else is interested in this use case, please 👍 on the original PR description which can help us with prioritization.

Hi @bflad , thanks for your very qualitative and fast inputs, it seems like a great idea to create a new datasource for this special usecase, I am about to close this PR and replace it by #390 that I think is cleaner and I will fill all the information you need in this new PR in coming days.

Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants