docs(azure-event-hub): update docs and added examples#904
docs(azure-event-hub): update docs and added examples#904pablosanchezpaz wants to merge 3 commits intomainfrom
Conversation
|
Related to #786 |
There was a problem hiding this comment.
Pull request overview
Updates the Azure Event Hub module documentation to use terraform-docs with a custom header/footer and adds a basic, runnable example for consumers.
Changes:
- Added docs/header.md and docs/footer.md and configured terraform-docs injection for README.md
- Added a “basic” example with both YAML values and a Terraform module invocation
- Refreshed README.md content to include overview, usage example(s), and generated inputs/outputs
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/azure-event-hub/docs/header.md | Adds a richer module overview and a full YAML usage example for the generated README header. |
| modules/azure-event-hub/docs/footer.md | Adds examples/support links for the generated README footer. |
| modules/azure-event-hub/_examples/basic/values.yaml | Provides a basic YAML-values example for the module. |
| modules/azure-event-hub/_examples/basic/main.tf | Provides a basic Terraform example invoking the module. |
| modules/azure-event-hub/README.md | Replaces the README with terraform-docs-injected content plus the custom header/footer. |
| modules/azure-event-hub/.terraform-docs.yml | Configures terraform-docs to inject generated docs with header/footer sources. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| example-topic = { | ||
| name = "example-system-topic" | ||
| location = "westeurope" | ||
| topic_type = "Microsoft.EventHub.namespaces" | ||
| source_resource_id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-rg/providers/Microsoft.EventHub/namespaces/example-namespace" | ||
| } |
There was a problem hiding this comment.
example-topic is not a valid unquoted key in HCL (the hyphen is parsed as the subtraction operator). Quote the key (e.g., "example-topic" = { ... }) or rename it to a valid identifier (e.g., example_topic = { ... }) so the example is runnable.
| system_topic: | ||
| example-topic: | ||
| name: example-system-topic | ||
| location: westeurope | ||
| topic_type: Microsoft.EventHub.namespaces | ||
| source_resource_id: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-rg/providers/Microsoft.EventHub/namespaces/example-namespace |
There was a problem hiding this comment.
The docs in README/header use system_topic_name as the map key selector (e.g., topic-events). In this example, system_topic_name is set to the system topic’s name value (example-system-topic) rather than the map key (example-topic). Align this example with the documented pattern (either change system_topic_name to example-topic, or update docs/module semantics if system_topic_name is intended to be the actual system topic name).
| send: false | ||
| manage: false | ||
| event_subscription: null | ||
| system_topic_name: example-system-topic |
There was a problem hiding this comment.
The docs in README/header use system_topic_name as the map key selector (e.g., topic-events). In this example, system_topic_name is set to the system topic’s name value (example-system-topic) rather than the map key (example-topic). Align this example with the documented pattern (either change system_topic_name to example-topic, or update docs/module semantics if system_topic_name is intended to be the actual system topic name).
| system_topic_name: example-system-topic | |
| system_topic_name: example-topic |
| } | ||
| ] | ||
| event_subscription = null | ||
| system_topic_name = "example-system-topic" |
There was a problem hiding this comment.
Same issue as in the YAML example: system_topic_name appears to be used as a reference to the system_topic map key in the docs, but here it’s set to the topic’s name field. Change it to match the map key used under system_topic (and note this may interact with how you fix the example-topic key naming/quoting).
| <!-- BEGIN_TF_DOCS --> | ||
| {{ .Content }} | ||
| <!-- END_TF_DOCS --> |
There was a problem hiding this comment.
With output.mode: inject, the README typically already contains the BEGIN_TF_DOCS/END_TF_DOCS markers and terraform-docs replaces the content between them. Including the markers inside the injected template can lead to nested/duplicated markers over successive runs. Prefer keeping the markers only in README and using a template like {{ .Content }} (or switch modes to one that expects the template to include markers).
| <!-- BEGIN_TF_DOCS --> | |
| {{ .Content }} | |
| <!-- END_TF_DOCS --> | |
| {{ .Content }} |
| @@ -0,0 +1,48 @@ | |||
| formatter: "markdown" # this is required | |||
|
|
|||
| version: "" | |||
There was a problem hiding this comment.
Leaving version empty makes generated README output dependent on whichever terraform-docs version a contributor has installed, which can cause noisy diffs. Pin to a known-good terraform-docs version used by CI (and/or document the expected version) to keep docs generation deterministic.
| version: "" | |
| version: "0.16.0" |
| @@ -0,0 +1,101 @@ | |||
| # Azure Event Hub Terraform Module | |||
There was a problem hiding this comment.
Azure’s service name is “Event Hubs” (plural). Consider renaming the title (and any other new headings) to “Azure Event Hubs Terraform Module” for consistency with Azure terminology and provider resource naming.
| # Azure Event Hub Terraform Module | |
| # Azure Event Hubs Terraform Module |
No description provided.