|
| 1 | +# Terraform Template - Azure VPN Gateway |
| 2 | + |
| 3 | +Costa Rica |
| 4 | + |
| 5 | +[](https://github.com/) |
| 6 | +[brown9804](https://github.com/brown9804) |
| 7 | + |
| 8 | +Last updated: 2025-06-13 |
| 9 | + |
| 10 | +---------- |
| 11 | + |
| 12 | +> This template contains Terraform configurations to create and manage an Azure VPN Gateway, including a virtual network, GatewaySubnet, and public IP. |
| 13 | +
|
| 14 | +> [!NOTE] |
| 15 | +> The subnet used for Azure VPN Gateway **must** be named `GatewaySubnet` and sized at least /27. |
| 16 | +
|
| 17 | +<p align="center"> |
| 18 | + <img width="700" alt="image" src="https://github.com/user-attachments/assets/c87943f7-5550-4e59-8059-3c236ec00f53"> |
| 19 | +</p> |
| 20 | + |
| 21 | +## File Descriptions |
| 22 | + |
| 23 | +- **main.tf**: Contains the main configuration for creating the Azure VPN Gateway and its supporting resources. |
| 24 | +- **variables.tf**: Defines the input variables used in the Terraform configuration. |
| 25 | +- **terraform.tfvars**: Provides default values for the variables defined in `variables.tf`. |
| 26 | +- **outputs.tf**: Defines the outputs such as VPN Gateway ID and public IP address. |
| 27 | + |
| 28 | +## Variables |
| 29 | + |
| 30 | +| Variable Name | Description | Type | Example Value | |
| 31 | +|---------------------- |--------------------------------------------------|--------|-----------------------------| |
| 32 | +| `subscription_id` | The Azure subscription ID | string | `"00000000-0000-0000-0000-000000000000"` | |
| 33 | +| `resource_group_name` | The name of the resource group | string | `"my-vpngw-rg"` | |
| 34 | +| `location` | The Azure region to deploy resources | string | `"eastus"` | |
| 35 | +| `public_ip_name` | The name of the public IP address for the VPN Gateway | string | `"my-vpngw-pip"` | |
| 36 | +| `vpn_gateway_name` | The name of the VPN Gateway | string | `"my-vpngw"` | |
| 37 | +| `vpn_gateway_sku` | The SKU for the VPN Gateway | string | `"VpnGw1"` | |
| 38 | + |
| 39 | +## Usage |
| 40 | + |
| 41 | +1. Clone the repository and navigate to the vpn-gateway directory. |
| 42 | +2. Update the `terraform.tfvars` file with your values. |
| 43 | +3. Initialize and apply the Terraform configuration: |
| 44 | + |
| 45 | +```bash |
| 46 | +terraform init |
| 47 | +terraform plan |
| 48 | +terraform apply |
| 49 | +``` |
| 50 | + |
| 51 | +## Outputs |
| 52 | + |
| 53 | +| Output Name | Description | |
| 54 | +|-----------------------|---------------------------------------------| |
| 55 | +| `vpn_gateway_id` | The ID of the VPN Gateway | |
| 56 | +| `vpn_gateway_public_ip` | The public IP address of the VPN Gateway | |
| 57 | + |
| 58 | +<div align="center"> |
| 59 | + <h3 style="color: #4CAF50;">Total Visitors</h3> |
| 60 | + <img src="https://profile-counter.glitch.me/brown9804/count.svg" alt="Visitor Count" style="border: 2px solid #4CAF50; border-radius: 5px; padding: 5px;"/> |
| 61 | +</div> |
0 commit comments