-
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
New Resource - azurerm_signalr_service_custom_domain
, azurerm_web_pubsub_custom_domain
#21153
Conversation
acc tests:
|
azurerm_signalr_custom_domain
, azurerm_web_pubsub_custom_domain
azurerm_signalr_service_custom_domain
, azurerm_web_pubsub_custom_domain
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.
tests are failing:
------- Stdout: -------
=== RUN TestAccSignalrServiceCustomDomainResource_basic
=== PAUSE TestAccSignalrServiceCustomDomainResource_basic
=== CONT TestAccSignalrServiceCustomDomainResource_basic
testcase.go:110: Step 1/2 error: Error running pre-apply refresh: exit status 1
Error: Reference to undeclared resource
on terraform_plugin_test.tf line 65, in resource "azurerm_key_vault" "test":
65: object_id = data.azurerm_signalr_service.test.identity[0].principal_id
A data resource "azurerm_signalr_service" "test" has not been declared in the
root module.
Error: Invalid resource type
on terraform_plugin_test.tf line 100, in resource "azurerm_signalr_custom_domain" "test":
100: resource "azurerm_signalr_custom_domain" "test" {
The provider hashicorp/azurerm does not support resource type
"azurerm_signalr_custom_domain".
--- FAIL: TestAccSignalrServiceCustomDomainResource_basic (2.48s)
FAIL
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 @xiaxyi. Overall this is looking good, I left some comments on the resources as well as regarding casing and consistency in the docs. Once those are resolved we can take another look through and get this merged!
internal/services/signalr/signalr_service_custom_domain_resource.go
Outdated
Show resolved
Hide resolved
internal/services/signalr/signalr_service_custom_domain_resource.go
Outdated
Show resolved
Hide resolved
internal/services/signalr/signalr_service_custom_domain_resource.go
Outdated
Show resolved
Hide resolved
internal/services/signalr/signalr_service_custom_domain_resource.go
Outdated
Show resolved
Hide resolved
internal/services/signalr/signalr_service_custom_domain_resource_test.go
Outdated
Show resolved
Hide resolved
internal/services/signalr/signalr_service_custom_domain_resource.go
Outdated
Show resolved
Hide resolved
internal/services/signalr/signalr_service_custom_domain_resource.go
Outdated
Show resolved
Hide resolved
Thanks @katbyte for the comment, the operation to update the custom domain of SignalR service is actually updating the SignalR service's property. The two APIs are not totally independent, so we need to ensure SignalR update is finished before moving forward to another operation. |
@xiaxyi - coming back to my initial comment and suggestion if creating/updating the custom domain updates the parent resource then we should have the logic that checks the status in the create/update and only return once it's ready instead of waiting for it in the delete. Does that make sense? |
@stephybun thanks for replying back, as we discussed offline. The reason to add the signalR waiter here is to ensure the delete can be started when siganlR service is not being updated by another operation since the operation on custom domain is actually updating the signalR service. can you let me know the concerns of this waiting function? |
@xiaxyi after discussion with @tombuildsstuff the following needs to be done:
Ensuring the resource is in a ready state before deletion is outside of the scope for terraform - one of the core tenants is that when we've finished a create or update of something it is truly ready and fully provisioned. If you can make the changes outlined above we can take another look through this. |
Thanks @stephybun for the comment, I updated the code, can you take a look and let me know if anything needed. |
Add API issue link:Azure/azure-rest-api-specs#23986 |
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 🌵
|
||
deadline, ok := ctx.Deadline() | ||
if !ok { | ||
return fmt.Errorf("context had no deadline") |
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.
return fmt.Errorf("context had no deadline") | |
return fmt.Errorf("internal-error: context had no deadline") |
|
||
deadline, ok := ctx.Deadline() | ||
if !ok { | ||
return fmt.Errorf("context had no deadline") |
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.
return fmt.Errorf("context had no deadline") | |
return fmt.Errorf("internal-error: context had no deadline") |
|
||
deadline, ok := ctx.Deadline() | ||
if !ok { | ||
return fmt.Errorf("context had no deadline") |
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.
return fmt.Errorf("context had no deadline") | |
return fmt.Errorf("internal-error: context had no deadline") |
This functionality has been released in v3.58.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. |
The acc test requires some prerequisite:
azurerm_web_pubsub_custom_certificate
#21114 and New Resource -azurerm_signalr_service_custom_certificate
#21112any of the prerequisite mentioned above not satisfied will cause the acc test failure as the polling function is checking the resource provisioning status.