Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
5718f01
feat: first steps config and evolution azure vpn p2d and s2s module
jcframil Feb 10, 2026
7466c43
Merge branch 'main' into feat/azure-vpn
jcframil Feb 10, 2026
2b73169
feat: first steps config and evolution azure vpn p2d and s2s module
jcframil Feb 10, 2026
968bcc8
Merge branch 'feat/azure-vpn' of https://github.com/prefapp/tfm into …
jcframil Feb 10, 2026
c0cd825
Merge branch 'main' into feat/azure-vpn
jcframil Feb 24, 2026
20c8711
fix: add default values to variables
jcframil Feb 24, 2026
b2a80be
Merge branch 'feat/azure-vpn' of https://github.com/prefapp/tfm into …
jcframil Feb 24, 2026
e67bf75
fix: add default values to variables
jcframil Feb 24, 2026
050685f
fix: add default values to variables
jcframil Feb 24, 2026
d7fca05
fix: change variables
jcframil Feb 24, 2026
c82cdf2
fix: change variables
jcframil Feb 24, 2026
6a47021
fix: change variables
jcframil Feb 24, 2026
1595cc2
fix: change variables
jcframil Feb 24, 2026
273accd
fix: change variables
jcframil Feb 25, 2026
be03223
fix: change variables
jcframil Feb 26, 2026
0a32bf3
fix: change variables
jcframil Feb 26, 2026
fa6259d
fix: populate resource vpn with all posible values to extend configur…
jcframil Feb 26, 2026
481f071
fix: populate resource vpn with all posible values to extend configur…
jcframil Feb 26, 2026
01193c2
fix: change variables
jcframil Feb 26, 2026
04b440e
fix: change variables
jcframil Feb 26, 2026
75dccd9
fix: add s2s
jcframil Feb 26, 2026
518a235
fix: separate in two different modules vpn and connections
jcframil Feb 26, 2026
d92d5ce
fix: add config vpn-connection
jcframil Feb 27, 2026
9c682c6
fix: add config vpn-connection
jcframil Feb 27, 2026
790bb0e
fix: add config vpn-connection
jcframil Feb 27, 2026
d373ea1
fix: add config vpn-connection
jcframil Feb 27, 2026
66ed4fb
fix: split into 3 different modules
jcframil Feb 27, 2026
b2c26e3
fix: split into 3 different modules
jcframil Feb 27, 2026
ada1977
fix: tags linked to instance
jcframil Feb 27, 2026
bd0abd0
fix: tags linked to instance
jcframil Feb 27, 2026
2ce3589
Merge branch 'main' into feat/azure-vpn
jcframil Feb 27, 2026
7c9ff60
fix: tags linked to instance
jcframil Feb 27, 2026
f9c5784
fix: adapt variables
jcframil Feb 27, 2026
176c93c
fix: adapt variables
jcframil Feb 27, 2026
3937206
fix: adapt variables
jcframil Feb 27, 2026
0dc8a66
fix: adapt variables
jcframil Feb 27, 2026
5046fca
fix: adapt variables
jcframil Feb 27, 2026
94ffaa6
fix: adapt variables
jcframil Feb 27, 2026
ed9f159
fix: adapt variables
jcframil Feb 27, 2026
11830d9
fix: claims vnetgateway, localnetgateway, connection
jcframil Mar 3, 2026
f14b46f
fix: claims vnetgateway, localnetgateway, connection
jcframil Mar 6, 2026
2dd7750
fix: claims vnetgateway, localnetgateway, connection
jcframil Mar 6, 2026
aa354ea
fix: claims vnetgateway, localnetgateway, connection
jcframil Mar 6, 2026
9e8031d
fix: claims vnetgateway, localnetgateway, connection
jcframil Mar 6, 2026
0e84d1a
fix: claims vnetgateway, localnetgateway, connection
jcframil Mar 6, 2026
f744cf0
fix: claims vnetgateway, localnetgateway, connection
jcframil Mar 6, 2026
a9115f8
fix: claims vnetgateway, localnetgateway, connection
jcframil Mar 6, 2026
3263ab6
fix: claims vnetgateway, localnetgateway, connection
jcframil Mar 6, 2026
f316eac
fix: claims vnetgateway, localnetgateway, connection
jcframil Mar 6, 2026
063cdff
fix: claims vnetgateway, localnetgateway, connection
jcframil Mar 6, 2026
d909650
fix: claims vnetgateway, localnetgateway, connection
jcframil Mar 6, 2026
1f3d7d5
fix: claims vnetgateway, localnetgateway, connection
jcframil Mar 6, 2026
b667721
fix: tags adaptation and record ovac pro tgss postgresql
jcframil Mar 9, 2026
06b4696
fix: tags adaptation and record ovac pro tgss postgresql
jcframil Mar 9, 2026
dbe5558
fix: tags adaptation and record ovac pro tgss postgresql
jcframil Mar 9, 2026
9a87f16
fix: claims vnetgateway, localnetgateway, connection
jcframil Mar 9, 2026
29341e6
fix: tf format
jcframil Mar 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions modules/azure-localnet-gateway/.terraform-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
formatter: "markdown"

version: ""

header-from: docs/header.md
footer-from: docs/footer.md

recursive:
enabled: false
path: modules
include-main: true

sections:
hide: []
show: []

content: ""

output:
file: "README.md"
mode: inject
template: |-
<!-- BEGIN_TF_DOCS -->
{{ .Content }}
<!-- END_TF_DOCS -->

output-values:
enabled: false
from: ""

sort:
enabled: true
by: name

settings:
anchor: true
color: true
default: true
description: false
escape: true
hide-empty: false
html: true
indent: 2
lockfile: true
read-comments: true
required: true
sensitive: true
type: true
88 changes: 88 additions & 0 deletions modules/azure-localnet-gateway/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<!-- BEGIN_TF_DOCS -->
# **Azure Local Network Gateway Terraform Module**

## Overview

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.

## Key Features

- **Multiple Gateway Support**: Create one or more Azure Local Network Gateways with flexible configuration.
- **Custom Address Spaces**: Define custom address spaces and gateway IPs for each local network.
- **Tag Inheritance and Customization**: Inherit tags from the resource group or specify custom tags for all resources.
- **Extensible and Modular**: Designed for easy extension and integration with other Azure network modules.

## Basic Usage

See the main README and the `_examples/` directory for usage examples.

```hcl
module "localnet_gateway" {
source = "./modules/azure-localnet-gateway"
localnet = [
{
local_gateway_name = "example-gateway"
location = "westeurope"
resource_group_name = "example-rg"
local_gateway_ip = "203.0.113.1"
local_gateway_address_space = ["10.1.0.0/16"]
tags_from_rg = true
tags = {
environment = "dev"
}
}
]
}
```

## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.7.0 |
| <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) | 4.58.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_azurerm"></a> [azurerm](#provider\_azurerm) | 4.58.0 |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [azurerm_local_network_gateway.this](https://registry.terraform.io/providers/hashicorp/azurerm/4.58.0/docs/resources/local_network_gateway) | resource |
| [azurerm_resource_group.this](https://registry.terraform.io/providers/hashicorp/azurerm/4.58.0/docs/data-sources/resource_group) | data source |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_localnet"></a> [localnet](#input\_localnet) | List of local network gateway objects | <pre>list(object({<br/> local_gateway_name = string<br/> location = string<br/> resource_group_name = string<br/> local_gateway_ip = string<br/> local_gateway_address_space = list(string)<br/> tags_from_rg = optional(bool)<br/> tags = optional(map(string))<br/> }))</pre> | `[]` | no |

## Outputs

No outputs.

## Examples

For detailed examples, refer to the [module examples](https://github.com/prefapp/tfm/tree/main/modules/azure-localnet-gateway/_examples):

- [basic\_localnet](https://github.com/prefapp/tfm/tree/main/modules/azure-localnet-gateway/_examples/basic\_localnet) - Basic local network gateway example.
- [multiple\_address\_spaces](https://github.com/prefapp/tfm/tree/main/modules/azure-localnet-gateway/_examples/multiple\_address\_spaces) - Example with multiple address spaces.
- [with\_tags\_from\_rg](https://github.com/prefapp/tfm/tree/main/modules/azure-localnet-gateway/_examples/with\_tags\_from\_rg) - Example inheriting tags from the resource group.

## Remote resources

- **Azure Local Network Gateway**: [azurerm\_local\_network\_gateway documentation](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/local_network_gateway)
- **Terraform Azure Provider**: [Terraform Provider documentation](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs)

## Support

For issues, questions, or contributions related to this module, please visit the [repository's issue tracker](https://github.com/prefapp/tfm/issues).
<!-- END_TF_DOCS -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module "localnet_gateway" {
source = "../../"
localnet = [{
local_gateway_name = "example-local-gw"
location = "westeurope"
resource_group_name = "example-rg"
local_gateway_ip = "203.0.113.1"
local_gateway_address_space = ["10.1.0.0/16"]
tags_from_rg = false
tags = { environment = "dev" }
}]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
localnet:
- local_gateway_name: example-local-gw
location: westeurope
resource_group_name: example-rg
local_gateway_ip: 203.0.113.1
local_gateway_address_space:
- 10.1.0.0/16
tags_from_rg: false
tags:
environment: dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module "localnet_gateway" {
source = "../../"
localnet = [{
local_gateway_name = "multi-space-gw"
location = "westeurope"
resource_group_name = "example-rg"
local_gateway_ip = "203.0.113.2"
local_gateway_address_space = ["10.1.0.0/16", "10.2.0.0/16"]
tags_from_rg = false
tags = { environment = "test" }
}]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
localnet:
- local_gateway_name: multi-space-gw
location: westeurope
resource_group_name: example-rg
local_gateway_ip: 203.0.113.2
local_gateway_address_space:
- 10.1.0.0/16
- 10.2.0.0/16
tags_from_rg: false
tags:
environment: test
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module "localnet_gateway" {
source = "../../"
localnet = [{
local_gateway_name = "tagged-gw"
location = "westeurope"
resource_group_name = "example-rg"
local_gateway_ip = "203.0.113.3"
local_gateway_address_space = ["10.3.0.0/16"]
tags_from_rg = true
tags = { custom = "yes" }
}]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
localnet:
- local_gateway_name: tagged-gw
location: westeurope
resource_group_name: example-rg
local_gateway_ip: 203.0.113.3
local_gateway_address_space:
- 10.3.0.0/16
tags_from_rg: true
tags:
custom: "yes"
7 changes: 7 additions & 0 deletions modules/azure-localnet-gateway/data.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## DATA SOURCES SECTION

# https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/virtual_network
data "azurerm_resource_group" "this" {
for_each = { for idx, s in var.localnet : idx => s }
name = each.value.resource_group_name
}
16 changes: 16 additions & 0 deletions modules/azure-localnet-gateway/docs/footer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Examples

For detailed examples, refer to the [module examples](https://github.com/prefapp/tfm/tree/main/modules/azure-localnet-gateway/_examples):

- [basic_localnet](https://github.com/prefapp/tfm/tree/main/modules/azure-localnet-gateway/_examples/basic_localnet) - Basic local network gateway example.
- [multiple_address_spaces](https://github.com/prefapp/tfm/tree/main/modules/azure-localnet-gateway/_examples/multiple_address_spaces) - Example with multiple address spaces.
- [with_tags_from_rg](https://github.com/prefapp/tfm/tree/main/modules/azure-localnet-gateway/_examples/with_tags_from_rg) - Example inheriting tags from the resource group.

## Remote resources

- **Azure Local Network Gateway**: [azurerm_local_network_gateway documentation](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/local_network_gateway)
- **Terraform Azure Provider**: [Terraform Provider documentation](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs)

## Support

For issues, questions, or contributions related to this module, please visit the [repository's issue tracker](https://github.com/prefapp/tfm/issues).
35 changes: 35 additions & 0 deletions modules/azure-localnet-gateway/docs/header.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# **Azure Local Network Gateway Terraform Module**

## Overview

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.

## Key Features

- **Multiple Gateway Support**: Create one or more Azure Local Network Gateways with flexible configuration.
- **Custom Address Spaces**: Define custom address spaces and gateway IPs for each local network.
- **Tag Inheritance and Customization**: Inherit tags from the resource group or specify custom tags for all resources.
- **Extensible and Modular**: Designed for easy extension and integration with other Azure network modules.

## Basic Usage

See the main README and the `_examples/` directory for usage examples.

```hcl
module "localnet_gateway" {
source = "./modules/azure-localnet-gateway"
localnet = [
{
local_gateway_name = "example-gateway"
location = "westeurope"
resource_group_name = "example-rg"
local_gateway_ip = "203.0.113.1"
local_gateway_address_space = ["10.1.0.0/16"]
tags_from_rg = true
tags = {
environment = "dev"
}
}
]
}
```
12 changes: 12 additions & 0 deletions modules/azure-localnet-gateway/locals.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## LOCALS SECTION

locals {
# Handle tags based on whether to use resource group tags or module-defined tags for each local network gateway (key = idx)
tags = { for idx, s in var.localnet :
idx => (
coalesce(s.tags_from_rg, false)
? merge(lookup(data.azurerm_resource_group.this, idx, null) != null ? data.azurerm_resource_group.this[idx].tags : {}, try(s.tags, {}))
: try(s.tags, {})
)
}
}
12 changes: 12 additions & 0 deletions modules/azure-localnet-gateway/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## LOCAL NETWORK GATEWAY SECTION

# https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/local_network_gateway
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
resource_group_name = each.value.resource_group_name
gateway_address = each.value.local_gateway_ip
address_space = each.value.local_gateway_address_space
tags = local.tags[each.key]
}
15 changes: 15 additions & 0 deletions modules/azure-localnet-gateway/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## VARIABLES SECTION

variable "localnet" {
description = "List of local network gateway objects"
type = list(object({
local_gateway_name = string
location = string
resource_group_name = string
local_gateway_ip = string
local_gateway_address_space = list(string)
tags_from_rg = optional(bool)
tags = optional(map(string))
}))
default = []
}
10 changes: 10 additions & 0 deletions modules/azure-localnet-gateway/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
terraform {
required_version = ">= 1.7.0"

required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "4.58.0"
}
}
}
48 changes: 48 additions & 0 deletions modules/azure-vnet-gateway-connection/.terraform-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
formatter: "markdown"

version: ""

header-from: docs/header.md
footer-from: docs/footer.md

recursive:
enabled: false
path: modules
include-main: true

sections:
hide: []
show: []

content: ""

output:
file: "README.md"
mode: inject
template: |-
<!-- BEGIN_TF_DOCS -->
{{ .Content }}
<!-- END_TF_DOCS -->

output-values:
enabled: false
from: ""

sort:
enabled: true
by: name

settings:
anchor: true
color: true
default: true
description: false
escape: true
hide-empty: false
html: true
indent: 2
lockfile: true
read-comments: true
required: true
sensitive: true
type: true
Loading