|
| 1 | +# Terraform Template - Azure Traffic Manager |
| 2 | + |
| 3 | +Costa Rica |
| 4 | + |
| 5 | +[](https://github.com/) |
| 6 | +[brown9804](https://github.com/brown9804) |
| 7 | + |
| 8 | +Last updated: 2025-06-12 |
| 9 | + |
| 10 | +---------- |
| 11 | + |
| 12 | +> This template contains Terraform configurations to create and manage an Azure Traffic Manager profile, including DNS configuration and endpoint monitoring. |
| 13 | +
|
| 14 | +> [!NOTE] |
| 15 | +> This Traffic Manager configuration uses best practices for routing, monitoring, and DNS setup. |
| 16 | +
|
| 17 | +<p align="center"> |
| 18 | + <img width="550" alt="image" src="https://github.com/user-attachments/assets/32680750-b3c9-4149-b0a9-677bcaccffca"> |
| 19 | +</p> |
| 20 | + |
| 21 | +## File Descriptions |
| 22 | + |
| 23 | +- **main.tf**: Contains the main configuration for creating the Azure Traffic Manager profile and its associated resources. |
| 24 | +- **variables.tf**: Defines the input variables used in the Terraform configuration. |
| 25 | +- **provider.tf**: Configures the Azure provider to interact with Azure resources. |
| 26 | +- **terraform.tfvars**: Provides default values for the variables defined in `variables.tf`. |
| 27 | +- **outputs.tf**: Defines the outputs such as Traffic Manager profile ID and FQDN. |
| 28 | + |
| 29 | +## Variables |
| 30 | + |
| 31 | +Below is a list of variables used in this template, their expected values, types, and examples: |
| 32 | + |
| 33 | +| Variable Name | Description | Type | Example Value | |
| 34 | +|------------------------ |-------------------------------------------------------|--------------|----------------------| |
| 35 | +| `resource_group_name` | The name of the resource group | string | `"tm-resource-group"` | |
| 36 | +| `location` | The Azure region for the resource group | string | `"eastus"` | |
| 37 | +| `traffic_manager_name` | The name of the Traffic Manager profile | string | `"my-tm-profile"` | |
| 38 | +| `traffic_routing_method`| The traffic routing method (Performance, Priority, etc.) | string | `"Performance"` | |
| 39 | +| `dns_name` | The relative DNS name for the Traffic Manager profile | string | `"mytmprofile"` | |
| 40 | +| `ttl` | The DNS Time-To-Live (TTL) in seconds | number | `30` | |
| 41 | +| `monitor_protocol` | The protocol used for endpoint monitoring | string | `"HTTP"` | |
| 42 | +| `monitor_port` | The port used for endpoint monitoring | number | `80` | |
| 43 | +| `monitor_path` | The path used for endpoint monitoring | string | `"/"` | |
| 44 | + |
| 45 | +## Usage |
| 46 | + |
| 47 | +1. Clone the repository and navigate to the traffic-manager directory. |
| 48 | +2. Update the `terraform.tfvars` file with your values. |
| 49 | +3. Initialize and apply the Terraform configuration: |
| 50 | + |
| 51 | +```bash |
| 52 | +terraform init |
| 53 | +terraform plan |
| 54 | +terraform apply |
| 55 | +``` |
| 56 | + |
| 57 | +## Outputs |
| 58 | + |
| 59 | +| Output Name | Description | |
| 60 | +|----------------------------|---------------------------------------------| |
| 61 | +| `traffic_manager_profile_id` | The ID of the Traffic Manager profile | |
| 62 | +| `traffic_manager_fqdn` | The FQDN of the Traffic Manager profile | |
| 63 | + |
| 64 | +<div align="center"> |
| 65 | + <h3 style="color: #4CAF50;">Total Visitors</h3> |
| 66 | + <img src="https://profile-counter.glitch.me/brown9804/count.svg" alt="Visitor Count" style="border: 2px solid #4CAF50; border-radius: 5px; padding: 5px;"/> |
| 67 | +</div> |
0 commit comments