docs(azure-nsg-nsr): update docs and added examples#900
docs(azure-nsg-nsr): update docs and added examples#900pablosanchezpaz wants to merge 1 commit intomainfrom
Conversation
|
Related to #786 |
There was a problem hiding this comment.
Pull request overview
Updates the Azure NSG/NSR module documentation by adding terraform-docs templating (header/footer), expanding README content, and introducing a basic example configuration.
Changes:
- Added terraform-docs header/footer markdown and configured terraform-docs injection into
README.MD. - Added a “basic” example (Terraform +
values.yaml) for the module. - Expanded README with generated Inputs/Outputs/Resources sections and example links.
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-nsg-nsr/docs/header.md | Adds a terraform-docs header with module overview and inline HCL/YAML examples. |
| modules/azure-nsg-nsr/docs/footer.md | Adds a terraform-docs footer with example links and support/resources references. |
| modules/azure-nsg-nsr/_examples/basic/values.yaml | Introduces a basic YAML values example for the module. |
| modules/azure-nsg-nsr/_examples/basic/main.tf | Introduces a basic Terraform usage example using the local module source. |
| modules/azure-nsg-nsr/README.MD | Injects terraform-docs generated content including usage examples and tables. |
| modules/azure-nsg-nsr/.terraform-docs.yml | Adds terraform-docs configuration for README injection with header/footer. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| values: | ||
| tags_from_rg: false | ||
| tags: | ||
| env: "Production" | ||
| nsg: | ||
| name: "example-nsg" | ||
| location: "East US" | ||
| resource_group_name: "example-rg" | ||
| rules: | ||
| rule1: | ||
| name: "AllowSSH" | ||
| priority: 100 | ||
| direction: "Inbound" | ||
| access: "Allow" | ||
| protocol: "Tcp" | ||
| source_port_range: "*" | ||
| destination_port_range: "22" | ||
| source_address_prefix: "10.0.0.0/24" | ||
| destination_address_prefix: "*" | ||
| rule2: | ||
| name: "AllowHTTP" | ||
| priority: 200 | ||
| direction: "Inbound" | ||
| access: "Allow" | ||
| protocol: "Tcp" | ||
| source_port_range: "*" | ||
| destination_port_range: "80" | ||
| source_address_prefix: "0.0.0.0/0" | ||
| destination_address_prefix: "*" |
There was a problem hiding this comment.
The YAML example is wrapped under a top-level values: key, but the added example file modules/azure-nsg-nsr/_examples/basic/values.yaml is not. This inconsistency is likely to confuse users—either update the docs to match the actual example format (remove the values: wrapper) or change the example values.yaml to include the values: wrapper, depending on what your tooling expects.
| values: | |
| tags_from_rg: false | |
| tags: | |
| env: "Production" | |
| nsg: | |
| name: "example-nsg" | |
| location: "East US" | |
| resource_group_name: "example-rg" | |
| rules: | |
| rule1: | |
| name: "AllowSSH" | |
| priority: 100 | |
| direction: "Inbound" | |
| access: "Allow" | |
| protocol: "Tcp" | |
| source_port_range: "*" | |
| destination_port_range: "22" | |
| source_address_prefix: "10.0.0.0/24" | |
| destination_address_prefix: "*" | |
| rule2: | |
| name: "AllowHTTP" | |
| priority: 200 | |
| direction: "Inbound" | |
| access: "Allow" | |
| protocol: "Tcp" | |
| source_port_range: "*" | |
| destination_port_range: "80" | |
| source_address_prefix: "0.0.0.0/0" | |
| destination_address_prefix: "*" | |
| tags_from_rg: false | |
| tags: | |
| env: "Production" | |
| nsg: | |
| name: "example-nsg" | |
| location: "East US" | |
| resource_group_name: "example-rg" | |
| rules: | |
| rule1: | |
| name: "AllowSSH" | |
| priority: 100 | |
| direction: "Inbound" | |
| access: "Allow" | |
| protocol: "Tcp" | |
| source_port_range: "*" | |
| destination_port_range: "22" | |
| source_address_prefix: "10.0.0.0/24" | |
| destination_address_prefix: "*" | |
| rule2: | |
| name: "AllowHTTP" | |
| priority: 200 | |
| direction: "Inbound" | |
| access: "Allow" | |
| protocol: "Tcp" | |
| source_port_range: "*" | |
| destination_port_range: "80" | |
| source_address_prefix: "0.0.0.0/0" | |
| destination_address_prefix: "*" |
| tags_from_rg: false | ||
| tags: | ||
| env: Production | ||
|
|
||
| nsg: | ||
| name: example-nsg | ||
| location: westeurope | ||
| resource_group_name: example-rg | ||
|
|
||
| rules: | ||
| rule1: | ||
| name: AllowSSH | ||
| priority: 100 | ||
| direction: Inbound | ||
| access: Allow | ||
| protocol: Tcp | ||
| source_port_range: "*" | ||
| destination_port_range: "22" | ||
| source_address_prefix: 10.0.0.0/24 | ||
| destination_address_prefix: "*" | ||
| rule2: | ||
| name: AllowHTTP | ||
| priority: 200 | ||
| direction: Inbound | ||
| access: Allow | ||
| protocol: Tcp | ||
| source_port_range: "*" | ||
| destination_port_range: "80" | ||
| source_address_prefix: 0.0.0.0/0 | ||
| destination_address_prefix: "*" No newline at end of file |
There was a problem hiding this comment.
This example values.yaml format conflicts with the YAML shown in the docs/README (which uses a top-level values: key). Align the on-disk example format with the documentation to avoid copy/paste failures.
| tags_from_rg: false | |
| tags: | |
| env: Production | |
| nsg: | |
| name: example-nsg | |
| location: westeurope | |
| resource_group_name: example-rg | |
| rules: | |
| rule1: | |
| name: AllowSSH | |
| priority: 100 | |
| direction: Inbound | |
| access: Allow | |
| protocol: Tcp | |
| source_port_range: "*" | |
| destination_port_range: "22" | |
| source_address_prefix: 10.0.0.0/24 | |
| destination_address_prefix: "*" | |
| rule2: | |
| name: AllowHTTP | |
| priority: 200 | |
| direction: Inbound | |
| access: Allow | |
| protocol: Tcp | |
| source_port_range: "*" | |
| destination_port_range: "80" | |
| source_address_prefix: 0.0.0.0/0 | |
| destination_address_prefix: "*" | |
| values: | |
| tags_from_rg: false | |
| tags: | |
| env: Production | |
| nsg: | |
| name: example-nsg | |
| location: westeurope | |
| resource_group_name: example-rg | |
| rules: | |
| rule1: | |
| name: AllowSSH | |
| priority: 100 | |
| direction: Inbound | |
| access: Allow | |
| protocol: Tcp | |
| source_port_range: "*" | |
| destination_port_range: "22" | |
| source_address_prefix: 10.0.0.0/24 | |
| destination_address_prefix: "*" | |
| rule2: | |
| name: AllowHTTP | |
| priority: 200 | |
| direction: Inbound | |
| access: Allow | |
| protocol: Tcp | |
| source_port_range: "*" | |
| destination_port_range: "80" | |
| source_address_prefix: 0.0.0.0/0 | |
| destination_address_prefix: "*" |
| } | ||
| nsg = { | ||
| name = "example-nsg" | ||
| location = "East US" |
There was a problem hiding this comment.
The documentation uses location = \"East US\" while the _examples/basic Terraform/YAML uses westeurope. Consider using a single consistent location across all examples (or explicitly calling out that any Azure region is acceptable) to reduce confusion.
|
|
||
| | Name | Description | | ||
| |------|-------------| | ||
| | <a name="output_id"></a> [id](#output\_id) | OUTPUTS SECTION | |
There was a problem hiding this comment.
The generated Outputs table exposes a placeholder description (OUTPUTS SECTION), which is unhelpful for users. Update the corresponding output description in outputs.tf so terraform-docs produces a meaningful description (e.g., 'Network Security Group ID').
| | <a name="output_id"></a> [id](#output\_id) | OUTPUTS SECTION | | |
| | <a name="output_id"></a> [id](#output\_id) | Network Security Group ID | |
| version: "" | ||
|
|
There was a problem hiding this comment.
An empty version field is ambiguous. Prefer removing it entirely or pinning a specific terraform-docs version to make doc generation reproducible across environments/CI.
| version: "" |
| ## Resources and support | ||
|
|
||
| - [Official Azure Network Security Group documentation](https://learn.microsoft.com/en-us/azure/virtual-network/network-security-groups-overview) | ||
| - [Terraform reference for azurerm_network_security_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_security_group) | ||
| - [Terraform reference for azurerm_network_security_rule](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_security_rule) | ||
|
|
||
| ## Support | ||
|
|
||
| For issues, questions, or contributions related to this module, please visit the [repository's issue tracker](https://github.com/prefapp/tfm/issues). No newline at end of file |
There was a problem hiding this comment.
The footer has both 'Resources and support' and a separate 'Support' section immediately after, which is redundant. Consider merging into a single section (e.g., 'Resources' and include the issue tracker link there) to keep the footer concise.
| ## Resources and support | |
| - [Official Azure Network Security Group documentation](https://learn.microsoft.com/en-us/azure/virtual-network/network-security-groups-overview) | |
| - [Terraform reference for azurerm_network_security_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_security_group) | |
| - [Terraform reference for azurerm_network_security_rule](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_security_rule) | |
| ## Support | |
| For issues, questions, or contributions related to this module, please visit the [repository's issue tracker](https://github.com/prefapp/tfm/issues). | |
| ## Resources | |
| - [Official Azure Network Security Group documentation](https://learn.microsoft.com/en-us/azure/virtual-network/network-security-groups-overview) | |
| - [Terraform reference for azurerm_network_security_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_security_group) | |
| - [Terraform reference for azurerm_network_security_rule](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_security_rule) | |
| - For issues, questions, or contributions related to this module, please visit the [repository's issue tracker](https://github.com/prefapp/tfm/issues). |
| ## Resources and support | ||
|
|
||
| - [Official Azure Network Security Group documentation](https://learn.microsoft.com/en-us/azure/virtual-network/network-security-groups-overview) | ||
| - [Terraform reference for azurerm_network_security_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_security_group) | ||
| - [Terraform reference for azurerm_network_security_rule](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_security_rule) | ||
|
|
||
| ## Support | ||
|
|
||
| For issues, questions, or contributions related to this module, please visit the [repository's issue tracker](https://github.com/prefapp/tfm/issues). No newline at end of file |
There was a problem hiding this comment.
The footer has both 'Resources and support' and a separate 'Support' section immediately after, which is redundant. Consider merging into a single section (e.g., 'Resources' and include the issue tracker link there) to keep the footer concise.
| ## Resources and support | |
| - [Official Azure Network Security Group documentation](https://learn.microsoft.com/en-us/azure/virtual-network/network-security-groups-overview) | |
| - [Terraform reference for azurerm_network_security_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_security_group) | |
| - [Terraform reference for azurerm_network_security_rule](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_security_rule) | |
| ## Support | |
| For issues, questions, or contributions related to this module, please visit the [repository's issue tracker](https://github.com/prefapp/tfm/issues). | |
| ## Resources | |
| - [Official Azure Network Security Group documentation](https://learn.microsoft.com/en-us/azure/virtual-network/network-security-groups-overview) | |
| - [Terraform reference for azurerm_network_security_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_security_group) | |
| - [Terraform reference for azurerm_network_security_rule](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_security_rule) | |
| - For issues, questions, or contributions related to this module, please visit the [repository's issue tracker](https://github.com/prefapp/tfm/issues). |
No description provided.