-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
resource azurerm_dns_zone: Add option to re-use host_name with dns_zone with soa_record
creation
#22312
resource azurerm_dns_zone: Add option to re-use host_name with dns_zone with soa_record
creation
#22312
Conversation
dns_zone with soa_record
creationdns_zone with soa_record
creation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR!
I have left some additional mostly minor comments that once addressed this should be good to merge 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR!
I have left some additional mostly minor comments that once addressed this should be good to merge 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for updating this! I've left some minor comment, once they are resolved, then it should be good to go 👍
Besides, there are two CI errors that want to be fixed.
This comment was marked as off-topic.
This comment was marked as off-topic.
When a DNS zone is created in Azure, there is a default SOA record which is created. In this provider, a dns_zone with soa_record is done by: 1. creating the dns_zone 2. overwriting the soa_record of the zone with the data supplied in the soa_record config block The `soa_record` block makes it mandatory to add the host_name argument when it is specified. This is NOT desired in most cases since the host_name is the MNAME SOA field which is the name of the primary nameserver and is set by Azure. This commit attempts to fix this issue by: 1. allowing the `host_name` to be omitted when `soa_record` is specified 2. the host_name value will be derived from the original SOA record when the zone is created. This issue is partly a bug in Azure API since it is is mentioned in the [documentation](https://learn.microsoft.com/en-us/azure/dns/dns-zones-records#soa-records) that it should not be possible to update the 'host' property of the SOA record.
1. get soaRecord only rather than whole zone read 2. return Set(id) to original position 3. update documentation 4. update tests
6f89fe6
to
dcc654d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @fredericfran-gds
I hope you don't mind, but while reviewing I noticed a few other things that needed some work / changes so I've made those and I'm running the tests now. As soon as that's done I'll get another member of the team to quickly check my changes too and we should be able to get this in.
Thanks!
Hi, no problem at all. Thanks for fixing, we wanted to be conservative and still allow someone to modify the host/host_name because strangely the API allows that when the documentation says no. Could be an issue with Azure API. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🧬
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. |
When a DNS zone is created in Azure, there is a default SOA record which is created.
In this provider, a dns_zone with soa_record is done by:
The
soa_record
block makes it mandatory to add the host_name argument when it is specified. This is NOT desired in most cases since the host_name is the MNAME SOA field which is the name of the primary nameserver and is set by Azure.This commit attempts to fix this issue by:
host_name
to be omitted whensoa_record
is specifiedThis issue is partly a bug in Azure API since it is is mentioned in the documentation that it should not be possible to update the 'host' property of the SOA record.