-
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
Adding azurerm_dns_ds_record
and azurerm_dns_tlsa_record
#28213
base: main
Are you sure you want to change the base?
Conversation
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 @alexwilcox9!
A few things of note here:
- This PR contains too many changes, we will be able to review this quicker if you can split this PR out into it's constituent parts e.g. A PR for updating the
hashicorp/go-azure-sdk
, a PR for updating the version used by thedns
service package, a PR for adding the new data source and resource - We don't accept untyped resources or data sources in the provider anymore, there is a section in the contributor guidelines that explains what untyped and typed resources are. The guides on adding a new resource/data source are for typed resources and can help you out there
Hi @stephybun, thanks for the review I appreciate there's a lot going on in this commit but as the SDK doesn't have the required API version yet I can't really split that out into it's own PR. Once the SDK does have the appropriate version I'll absolutely split the changes out and then rebase this branch. I have split all of the changes into sensible commits, it might be more digestable to review each commit on its own I hadn't realised that only typed resources were being accepted, my apologies. And just a heads up, the documentation still advises not using typed resources I've re-written the resources/data sources as suggested, I'd appreciate your feedback as it's my first time using the new typed method. You'll also see another commit for I also note that every DNS record resource has a set of common attributes/arguments ( |
An example of what a shared schema could look like: |
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 rewriting these as typed resources @alexwilcox9 and for pointing out the outdated information in the sdk
folder! I will open a PR to remove these since they're no longer valid.
Overall this looks good, I only reviewed the DS record data source and resource in depth since it looks like the same comments that I left for those apply to the TLSA record data source and resource. I'd appreciate if you could propagate any changes you make to the DS record to the TLSA record.
I also note that every DNS record resource has a set of common attributes/arguments (name, resource_group_name, zone_name, ttl, fqdn and tags). Would it be appropriate to have those common schema/model components set once in a helper package and then extended with the unique aspects?
The typed SDK offers the ability to have resources share a common schema. We have some implementations of this in the provider today e.g. the cost management export resources for billing, resource groups and subscription that all "inherit" parts of their schema from a base resource. This is not an insignificant amount of effort to setup and to really reap the benefits of this all the resources that share parts of a schema need to be typed resources, so in this particular case I'm not convinced it's worth doing for these two typed resources.
A helper function that can be referenced in multiple places might seem helpful, but I find these actually end up making reviews more difficult since the reviewer doesn't have all the information for the resource at first glance (having to scroll down to a different file to view a helper and relate it back to where it's supposed to be is a personal gripe that I and other's in the team have) and when any changes are made to it in future we need to be cognisant of each resource that it will affect which complicates reviews.
Community Note
Description
Adding two new resources and data sources for the creation of DS and TLSA DNS records
This includes a bump to the DNS API version which is currently using a local override until the newer API version is available in the Go SDK (waiting on hashicorp/pandora#4583)
PR Checklist
For example: “
resource_name_here
- description of change e.g. adding propertynew_property_name_here
”Changes to existing Resource / Data Source
Testing
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_resource
- support for thething1
property [GH-00000]This is a (please select all that apply):
Related Issue(s)
Note
If this PR changes meaningfully during the course of review please update the title and description as required.