-
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
azurerm_monitor_diagnostic_setting
- wait resource to become ready in creation
#25697
Conversation
@teowa Thank you for using our new PR template, can you please update to include a description for this PR under the Description header? This helps with traceability for our users. |
Thanks for your contribution! |
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 @teowa. One comment to address, which will also need applying to the delete function for the same bug.
Can you also open an issue on the API Specs for this resource as the need for this suggests that the API call should in fact be an LRO with a poller if the resource is only completed async? Please include the issue link as a comment so we can track it and update if/when it is addressed.
Thanks!
Refresh: monitorDiagnosticSettingRefreshFunc(ctx, client, id), | ||
MinTimeout: 5 * time.Second, | ||
ContinuousTargetOccurence: 3, | ||
Timeout: d.Timeout(pluginsdk.TimeoutCreate), |
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.
Can we use the calculated deadline from the context here otherwise that will potentially expire before this WaitForStateContext
is complete. e.g.
deadline, ok := ctx.Deadline()
if !ok {
return fmt.Errorf("could not retrieve context deadline for %s", id.ID())
}
...
Timeout: time.Until(deadline)
Can you also update the other instance(s) of this bug in this resource while we're here?
@teowa - this is gtg i think once the rest api specs issue is opened anc linked to in the code via a comment |
Any ETA on merging this fix? Thanks! |
Hi @aliciaclark1066 , I am not sure if it is unstable API or other factor, I cannot repro the |
Hi @teowa, I appreciate your patience. Here are my terraform logs. Please let me know if you need anything else. |
Hi @aliciaclark1066 , thanks for providing the debug log. But the provided log is not available for this PR. I can find |
Close this for now because I am unable to repro the error thus unable to file a issue to REST API as suggested in #25697 (review), if anyone still meet the |
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. |
Community Note
Description
Wait until the resource is ready in creation. The wait logic is to query the status at a minimum interval of
5
seconds until3
consecutive response return that the resource exists. And if the resource doesn't exist the interval increases exponentially according toterraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry/state.go
Lines 185 to 190 in e39139b
PR Checklist
For example: “
resource_name_here
- description of change e.g. adding propertynew_property_name_here
”Changes to existing Resource / Data Source
Testing
Test result is OK. The failed test is because of subscription issue
The limit of 5 diagnostic settings was reached
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_monitor_diagnostic_setting
- wait resource to become ready in creationThis is a (please select all that apply):
Related Issue(s)
Fixes #25676
Fixes #25667
Note
If this PR changes meaningfully during the course of review please update the title and description as required.