-
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
provider: adding a cache around the Resource Provider Registration #21695
Conversation
…API Version `2022-09-01` This PR supersedes both #20050 and hashicorp/go-azure-helpers#158 by refactoring this to use a cache and then migrating this across to `hashicorp/go-azure-sdk`, since this needs to be migrated away from using `Azure/azure-sdk-for-go` anyway.
@manicminer @jackofallops I've moved this logic fully into the Provider, but part of me's wondering if this belongs within `hashicorp/go-azure-sdk - WDYT? |
…e during creation
Given the potential re-use in stack etc, possibly worth it in the longer term? But for now I think it's fine here? |
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 @tombuildsstuff - LGTM 👍
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.
I agree this is probably best in the provider, and personally I'd likely just copy it into azurestack as needed and leave it at that.
Tests look good 👍 |
This functionality has been released in v3.56.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
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. |
This PR supersedes #20050 and hashicorp/go-azure-helpers#158 and introduces a cache for the list of Resource Providers cached during provider startup.
As mentioned in #20050, the
providers
API can take 6-8s to respond - as such there's performance benefits to caching this, in theory. Whilst that PR looks reasonable, we actually need to remove this logic fromhashicorp/go-azure-helpers
(since it can't be migrated across to usinghashicorp/go-azure-sdk
without adding a circular reference - and this is also specific to Resource Manager API's).However since Terraform relaunches the provider binary multiple times - that is during a
terraform apply
the binary will be launched once to compute the plan and then another time post-plan confirmation - meaning that theproviders
API will still be called multiple times perterraform
run, however this'll be limited to one time per provider binary launch.As such this PR:
hashicorp/go-azure-sdk
(meaning we can remove this logic fromhashicorp/go-azure-helpers
).2022-09-01
.registrationState
field).Supersedes #20050
Supersedes hashicorp/go-azure-helpers#158