Skip to content

Feat/azure localnet gateway#973

Draft
jcframil wants to merge 61 commits intomainfrom
feat/azure-localnet-gateway
Draft

Feat/azure localnet gateway#973
jcframil wants to merge 61 commits intomainfrom
feat/azure-localnet-gateway

Conversation

@jcframil
Copy link
Contributor

@jcframil jcframil commented Mar 9, 2026

This pull request introduces a new Terraform module, azure-localnet-gateway, for provisioning Azure Local Network Gateways. The changes include module implementation, documentation, and example usage, making it ready for integration into larger projects or standalone use. Key highlights are flexible gateway configuration, tag inheritance, and comprehensive documentation.

Module implementation and configuration:

  • Added the complete Terraform module for Azure Local Network Gateways, including main.tf, variables.tf, locals.tf, data.tf, and versions.tf, supporting multiple gateways, custom address spaces, and tag inheritance from resource groups. [1] [2] [3] [4] [5]

Documentation and automation:

  • Introduced detailed documentation in README.md, modular header and footer files, and a .terraform-docs.yml configuration for automated doc generation. [1] [2] [3] [4]

Example usage:

  • Added three example scenarios (basic_localnet, multiple_address_spaces, with_tags_from_rg) in both Terraform and YAML formats, demonstrating flexible module usage and tag handling. [1] [2] [3] [4] [5] [6]

Repository configuration:

  • Registered the new module in release-please-config.json for automated release management.

jcframil and others added 30 commits February 10, 2026 11:10
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
…ation

Signed-off-by: jcframil <framiljuan@gmail.com>
…ation

Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
Signed-off-by: jcframil <framiljuan@gmail.com>
@jcframil jcframil requested a review from a team as a code owner March 9, 2026 15:49
jcframil and others added 2 commits March 9, 2026 16:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Terraform module to provision Azure Local Network Gateways (for S2S VPN scenarios) and wires it into the repository’s release automation configuration.

Changes:

  • Registers additional module packages in release-please-config.json.
  • Introduces modules/azure-localnet-gateway with resource, variables, locals, data source, and provider/version constraints.
  • Adds module documentation and example configurations.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
release-please-config.json Adds release-please package entries for new Azure networking modules.
modules/azure-localnet-gateway/versions.tf Declares Terraform + azurerm provider version constraints for the new module.
modules/azure-localnet-gateway/variables.tf Defines the localnet input object schema.
modules/azure-localnet-gateway/main.tf Creates azurerm_local_network_gateway resources from var.localnet.
modules/azure-localnet-gateway/locals.tf Builds per-gateway tags (optionally inheriting RG tags).
modules/azure-localnet-gateway/data.tf Loads resource group data for tag inheritance.
modules/azure-localnet-gateway/docs/header.md Human-facing module overview and usage snippet for terraform-docs.
modules/azure-localnet-gateway/docs/footer.md Links to examples and upstream Azure docs for terraform-docs footer.
modules/azure-localnet-gateway/_examples/basic_localnet/example.yaml Basic YAML example input for the module.
modules/azure-localnet-gateway/_examples/basic_localnet/example.tf Basic Terraform example consuming the module.
modules/azure-localnet-gateway/_examples/multiple_address_spaces/example.yaml YAML example with multiple address spaces.
modules/azure-localnet-gateway/_examples/multiple_address_spaces/example.tf Terraform example with multiple address spaces.
modules/azure-localnet-gateway/_examples/with_tags_from_rg/example.yaml YAML example demonstrating tag inheritance.
modules/azure-localnet-gateway/_examples/with_tags_from_rg/example.tf Terraform example demonstrating tag inheritance.
modules/azure-localnet-gateway/README.md Generated terraform-docs README for the new module.
modules/azure-localnet-gateway/.terraform-docs.yml terraform-docs configuration for README generation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +154 to +159
"modules/azure-vnet-gateway": {
"package-name": "azure-vnet-gateway"
},
"modules/azure-vnet-gateway-connection": {
"package-name": "azure-vnet-gateway-connection"
},
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

release-please-config.json adds packages for modules/azure-vnet-gateway and modules/azure-vnet-gateway-connection, but those module directories don't exist in this repo. This will cause release-please to try to manage non-existent packages; either add those modules in this PR or remove these entries.

Copilot uses AI. Check for mistakes.
Comment on lines +160 to 162
"modules/azure-localnet-gateway": {
"package-name": "azure-localnet-gateway"
}
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

New package modules/azure-localnet-gateway is added to release-please config, but there is no corresponding entry in .release-please-manifest.json (manifest currently ends at modules/aws-secretsmanager-replication). Release-please manifest mode typically requires adding the initial version for new packages, otherwise it won’t cut releases for this module.

Copilot uses AI. Check for mistakes.
Comment on lines +160 to 162
"modules/azure-localnet-gateway": {
"package-name": "azure-localnet-gateway"
}
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

This module is being added to release automation, but unlike the other modules it doesn’t include a CHANGELOG.md. If release-please is expected to update per-module changelogs (as it does elsewhere in modules/*/CHANGELOG.md), add an initial changelog file for azure-localnet-gateway to keep the release process consistent.

Copilot uses AI. Check for mistakes.
Comment on lines +4 to +8
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "4.58.0"
}
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

azurerm is pinned to an exact version (4.58.0). Because Terraform merges provider constraints across all modules in a root config, exact pins can easily create unsatisfiable constraints when combining modules (several modules in this repo use ~> 4.16.0 or other exact versions). Consider switching to a compatible range (e.g., ~> 4.58.0 or >= 4.16.0) to improve composability.

Copilot uses AI. Check for mistakes.
Comment on lines +4 to +7
resource "azurerm_local_network_gateway" "this" {
for_each = { for idx, s in var.localnet : idx => s }
name = each.value.local_gateway_name
location = each.value.location
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

for_each is keyed by list index (idx => s). Reordering var.localnet will change resource addresses and can force unnecessary destroy/create even when the gateway name hasn’t changed. Prefer a stable key derived from the object (e.g., "${resource_group_name}/${local_gateway_name}" or just local_gateway_name if guaranteed unique) to keep state stable.

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +7
This module provisions and manages Azure Local Network Gateways for Site-to-Site VPN connections using the [azurerm\_local\_network\_gateway](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/local_network_gateway) resource. It is suitable for production, staging, and development environments, y puede integrarse en proyectos Terraform más grandes o usarse de forma independiente.

Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

The overview paragraph mixes English and Spanish (“y puede integrarse…”). If the module docs are intended to be English (as in the rest of the repo), translate this fragment to keep documentation consistent.

Copilot uses AI. Check for mistakes.
Comment on lines +68 to +70
## Outputs

No outputs.
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

The module currently exposes no outputs, which makes it hard to reference created local network gateways from other modules (e.g., to create VPN connections). Consider adding outputs such as a map of gateway IDs keyed by a stable key (name or rg/name) and regenerate the terraform-docs README accordingly.

Copilot uses AI. Check for mistakes.
@jcframil jcframil marked this pull request as draft March 16, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants