Skip to content
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_action_group: support for the event_hub_receiver block #14771

Merged
merged 6 commits into from
Jan 9, 2022

Conversation

dennis-menge
Copy link
Contributor

@dennis-menge dennis-menge commented Jan 3, 2022

Fixes: #14374

Added EventHub Receiver Type for Monitor Action Group as it has gone GA on November 3rd

Since this feature was not supported by the Azure Go SDK until last week, I also had to bump the Azure SDK to v61.0.0

Acceptance Test output:

❯ make acctests SERVICE=monitor  TESTARGS='-run=TestAccMonitorActionGroup_eventHubReceiver' TESTTIMEOUT=60m
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
==> Checking that acceptance test packages are used...
TF_ACC=1 go test -v ./internal/services/monitor -run=TestAccMonitorActionGroup_eventHubReceiver -timeout 60m -ldflags="-X=github.com/hashicorp/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccMonitorActionGroup_eventHubReceiver
=== PAUSE TestAccMonitorActionGroup_eventHubReceiver
=== CONT  TestAccMonitorActionGroup_eventHubReceiver
--- PASS: TestAccMonitorActionGroup_eventHubReceiver (371.21s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/monitor 

@dennis-menge dennis-menge changed the title Added EventHub Receiver to Monitor Action Group Added EventHub Receiver Type to Monitor Action Group Jan 3, 2022
@dennis-menge dennis-menge changed the title Added EventHub Receiver Type to Monitor Action Group azurerm_monitor_action_group: Added EventHub Receiver Type to Monitor Action Group Jan 3, 2022
Comment on lines 173 to 175
* `event_hub_name` - (Required) The name of the specific Event Hub queue.
* `event_hub_namespace` - (Required) The Event Hub namespace.
* `subscription_id` - (Optional) The ID for the subscription containing this Event Hub.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of 3 separate properties could we use the event_hub_namespace.id and parse these out?

Copy link
Contributor Author

@dennis-menge dennis-menge Jan 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @katbyte, I like the idea. To get a better understanding, you suggest that we just take the ID of the EventHub Namespace and then use the EventHub client to retrieve the rest of the required data within expandMonitorActionGroupEventHubReceiver ?

Copy link
Contributor Author

@dennis-menge dennis-menge Jan 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I misunderstood you. You mean taking the resource id of the namespace directly and parse subscription id, event hub name and namespace from the id, right?

The issue is that the resource id of the namespace does not contain the name of the event hub.

This is an example resource id:
/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.EventHub/namespaces/namespace1

Hence, we would still need the event hub name, and the subscription id is optional anyways.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ID of the actual eventhub within the namespace would work however:

/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.EventHub/namespaces/namespace1/eventhubs/hub1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @katbyte I added your suggestions, happy for any feedback

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry my mistake i swapped hub and namespace in my mind 😅 perfect thanks

@katbyte katbyte changed the title azurerm_monitor_action_group: Added EventHub Receiver Type to Monitor Action Group azurerm_monitor_action_group: support for the event_hub_receiver block Jan 9, 2022
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @dennis-menge - LGTM ⛵

@katbyte katbyte merged commit 2100727 into hashicorp:main Jan 9, 2022
katbyte added a commit that referenced this pull request Jan 9, 2022
@github-actions github-actions bot added this to the v2.92.0 milestone Jan 9, 2022
@github-actions
Copy link

This functionality has been released in v2.92.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!

@github-actions
Copy link

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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for EventHub receiver on azurerm_monitor_action_group
2 participants