-
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 Resources: Notification Hubs #1589
Conversation
``` $ acctests azurerm TestAccAzureRMNotificationHubNamespace_ === RUN TestAccAzureRMNotificationHubNamespace_importFree --- PASS: TestAccAzureRMNotificationHubNamespace_importFree (134.35s) === RUN TestAccAzureRMNotificationHubNamespace_free --- PASS: TestAccAzureRMNotificationHubNamespace_free (126.57s) === RUN TestAccAzureRMNotificationHubNamespace_updateSku --- PASS: TestAccAzureRMNotificationHubNamespace_updateSku (143.16s) PASS ok github.com/terraform-providers/terraform-provider-azurerm/azurerm 404.111s ```
``` $ acctests azurerm TestAccDataSourceAzureRMNotificationHubNamespace_free === RUN TestAccDataSourceAzureRMNotificationHubNamespace_free --- PASS: TestAccDataSourceAzureRMNotificationHubNamespace_free (130.03s) PASS ok github.com/terraform-providers/terraform-provider-azurerm/azurerm 130.081s ```
d1c720b
to
7c8f0f6
Compare
``` $ acctests azurerm TestAccAzureRMNotificationHub_basic === RUN TestAccAzureRMNotificationHub_basic --- PASS: TestAccAzureRMNotificationHub_basic (284.22s) PASS ok github.com/terraform-providers/terraform-provider-azurerm/azurerm 284.273s ```
Renaming the fields to better match the portal/terms used in Apple/Google Dev Portals
Tests pass: ``` ```
59ca5de
to
3914a28
Compare
Tests pass: ``` $ acctests azurerm TestAccAzureRMNotificationHubNamespace_ === RUN TestAccAzureRMNotificationHubNamespace_importFree --- PASS: TestAccAzureRMNotificationHubNamespace_importFree (71.04s) === RUN TestAccAzureRMNotificationHubNamespace_free --- PASS: TestAccAzureRMNotificationHubNamespace_free (73.17s) === RUN TestAccAzureRMNotificationHubNamespace_updateSku --- PASS: TestAccAzureRMNotificationHubNamespace_updateSku (86.43s) PASS ok github.com/terraform-providers/terraform-provider-azurerm/azurerm 230.677s ```
Data Source tests pass:
|
``` azurerm_notification_hub_namespace.test: Error creating/updating Notification Hub Namesapce "acctestnhn-4049058900878420170" (Resource Group "acctestrg-4049058900878420170"): notificationhubs.NamespacesClient#CreateOrUpdate: Failure sending request: StatusCode=409 -- Original Error: autorest/azure: Service returned an error. Status=<nil> Code="Conflict" Message="Namespace acctestnhn-4049058900878420170 is in state Created. Cannot update the property" ```
} | ||
|
||
// try triggering a deleting again | ||
client.Delete(ctx, resourceGroupName, name) |
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.
just want to call this out as this looks odd on first glance - the Namespace delete method doesn't actually delete it some of the time, but repeatedly hitting it seems to work so 🙃
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 with just a few minor nits
token := input["token"].(string) | ||
|
||
applicationEndpoints := map[string]string{ | ||
"Production": "https://api.push.apple.com:443/3/device", |
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.
Thoughts on making the endpoints constants?
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.
👍 done
|
||
if endpoint := input.Endpoint; endpoint != nil { | ||
applicationEndpoints := map[string]string{ | ||
"https://api.push.apple.com:443/3/device": "Production", |
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.
Thoughts on making the endpoints constants?
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.
👍 done
Importer: &schema.ResourceImporter{ | ||
State: schema.ImportStatePassthrough, | ||
}, | ||
// TODO: customizeDiff for send+listen when manage selected |
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.
Just confirming that this is for later down the road
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.
yep, it's documented so this isn't necessary at this time
return fmt.Errorf("Error waiting for Notification Hub %q (Resource Group %q) to be deleted: %s", name, resourceGroup, err) | ||
} | ||
|
||
err = future.WaitForCompletionRef(ctx, client.Client) |
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.
Do we want to comment this out until the issue mentioned above is fixed? Or is it fine to wait for when the namespace is deleted?
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 thought I'd done this, but yes you're right this should be removed
51e72c4
to
5343ad5
Compare
Data Source tests still pass:
|
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
I went to start work on this and it turns out apparently I started this in April ¯_(ツ)_/¯
Notification Hub Namespaces
Notification Hub
Since this requires valid APNS and GCM credentials to test - I'll have to assert these manually for the moment; so the Acceptance Tests will be limited to the core Notification Hub workflow.
Notification Hub Authorization Rule
Other