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_kusto_eventhub_data_connection: support event_system_properties #11006

Merged
merged 2 commits into from
Mar 25, 2021
Merged

azurerm_kusto_eventhub_data_connection: support event_system_properties #11006

merged 2 commits into from
Mar 25, 2021

Conversation

favoretti
Copy link
Collaborator

Fixes #10993

$ make acctests SERVICE='kusto' TESTARGS='-run=TestAccKustoEventHubDataConnection_eventSystemProperties' TESTTIMEOUT='600m'
==> 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 ./azurerm/internal/services/kusto -run=TestAccKustoEventHubDataConnection_eventSystemProperties -timeout 600m -ldflags="-X=github.com/terraform-providers/terraform-provider-azurerm/version.ProviderVersion=acc"
2021/03/17 14:33:24 [DEBUG] not using binary driver name, it's no longer needed
2021/03/17 14:33:25 [DEBUG] not using binary driver name, it's no longer needed
=== RUN   TestAccKustoEventHubDataConnection_eventSystemProperties
=== PAUSE TestAccKustoEventHubDataConnection_eventSystemProperties
=== CONT  TestAccKustoEventHubDataConnection_eventSystemProperties
--- PASS: TestAccKustoEventHubDataConnection_eventSystemProperties (1460.05s)
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/kusto	1461.373s

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 @favoretti aside from a couple comments this is looking good

@@ -83,6 +83,16 @@ func resourceKustoEventHubDataConnection() *schema.Resource {
ValidateFunc: eventhubValidate.EventHubID,
},

"event_system_properties": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

event seems very vague here? as it applies to the eventhub:

Suggested change
"event_system_properties": {
"eventhub_system_properties": {

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It does apply to eventhub, but those are properties of a single event as far as I understand, not of eventhub on its own.
@derSchtefan since you originally requested this, can you chip in on semantics please? :)

Copy link
Member

Choose a reason for hiding this comment

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

These appear to be (System) Events - so the naming event_system_properties would make more sense than eventhub_system_properties here: https://docs.microsoft.com/en-us/azure/data-explorer/ingest-data-event-hub-overview#event-system-properties-mapping

Copy link
Collaborator

Choose a reason for hiding this comment

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

then perhaps system_event_properties? 🤔 docs will need to be updated either way as it currently states: a list of system properties for the Event Hub.

Copy link

Choose a reason for hiding this comment

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

@katbyte @favoretti EventHub and IoT Hub are based around Kafka, a similar open-source system. EventHub and IoT Hub both attach different SYSTEM properties to their events, that Kafka does not know about. One of them is x-opt-publisher which in conjunction with SAS token locked publisher endpoints allow you to identify who published an event (which is a nightmare to identify and make secure otherwise)

The property should be named event_system_properties because:

  • Microsoft names them like this not only in the portal but also the json schema
  • They are not specific to EventHub, but also include IoT Hub system properties
  • They are system properties of the event, as opposed to custom properties of the event

The list of potential event_system_properties can be found here:

IoT and EventHub both are mapped to EventHub ingestion internally, and work the same, since IoT hub is just an EventHub with some extra features. Other EventHub based systems might be added in the future.

Choose a reason for hiding this comment

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

See also @tombuildsstuff 's comment here: #11006 (comment)

Copy link
Member

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

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

Left a couple of comments inline but this otherwise LGTM 👍

"event_system_properties": {
Type: schema.TypeList,
Optional: true,
Computed: true,
Copy link
Member

Choose a reason for hiding this comment

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

does this need to be Computed?

Suggested change
Computed: true,

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep, since some of them are set implicitly and generated a diff otherwise.

@@ -83,6 +83,16 @@ func resourceKustoEventHubDataConnection() *schema.Resource {
ValidateFunc: eventhubValidate.EventHubID,
},

"event_system_properties": {
Copy link
Member

Choose a reason for hiding this comment

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

These appear to be (System) Events - so the naming event_system_properties would make more sense than eventhub_system_properties here: https://docs.microsoft.com/en-us/azure/data-explorer/ingest-data-event-hub-overview#event-system-properties-mapping

@favoretti favoretti requested a review from katbyte March 19, 2021 15:38
@katbyte katbyte merged commit da0b1c2 into hashicorp:master Mar 25, 2021
katbyte added a commit that referenced this pull request Mar 25, 2021
@ghost
Copy link

ghost commented Mar 26, 2021

This has been released in version 2.53.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.53.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Apr 24, 2021

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!

@ghost ghost locked as resolved and limited conversation to collaborators Apr 24, 2021
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.

azurerm_kusto_eventhub_data_connection is lacking eventSystemProperties (e.g. "x-opt-publisher")
4 participants