Azure module to deploy a Traffic Manager.
| Module version | Terraform version | OpenTofu version | AzureRM version |
|---|---|---|---|
| >= 8.x.x | Unverified | 1.8.x | >= 4.0 |
| >= 7.x.x | 1.3.x | >= 3.0 | |
| >= 6.x.x | 1.x | >= 3.0 | |
| >= 5.x.x | 0.15.x | >= 2.0 | |
| >= 4.x.x | 0.13.x / 0.14.x | >= 2.0 | |
| >= 3.x.x | 0.12.x | >= 2.0 | |
| >= 2.x.x | 0.12.x | < 2.0 | |
| < 2.x.x | 0.11.x | < 2.0 |
If you want to contribute to this repository, feel free to use our pre-commit git hook configuration which will help you automatically update and format some files for you by enforcing our Terraform code module best-practices.
More details are available in the CONTRIBUTING.md file.
This module is optimized to work with the Claranet terraform-wrapper tool
which set some terraform variables in the environment needed by this module.
More details about variables set by the terraform-wrapper available in the documentation.
module "traffic_manager" {
source = "claranet/traffic-manager/azurerm"
version = "x.x.x"
resource_group_name = module.rg.name
location_short = module.azure_region.location_short
client_name = var.client_name
environment = var.environment
stack = var.stack
traffic_routing_method = "Performance"
dns_config = {
relative_name = "my_traffic_manager_profile"
ttl = 100
}
monitor_config = {
protocol = "HTTP"
port = 80
path = "/"
expected_status_code_ranges = ["200-299"]
custom_header = [
{
name = "my-custom-header"
value = "Content-Type"
},
]
interval_in_seconds = 30
timeout_in_seconds = 10
tolerated_number_of_failures = 3
}
logs_destinations_ids = [
module.run.logs_storage_account_id,
module.run.log_analytics_workspace_id
]
extra_tags = {
foo = "bar"
}
}| Name | Version |
|---|---|
| azurecaf | ~> 1.3.0 |
| azurerm | ~> 4.31 |
| Name | Source | Version |
|---|---|---|
| diagnostics | claranet/diagnostic-settings/azurerm | ~> 8.2 |
| Name | Type |
|---|---|
| azurerm_traffic_manager_profile.main | resource |
| azurecaf_name.traffic_manager | data source |
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| client_name | Client name/account used in naming. | string |
n/a | yes |
| custom_name | Custom Traffic Manager, generated if not set. | string |
"" |
no |
| default_tags_enabled | Option to enable or disable default tags. | bool |
true |
no |
| diagnostic_settings_custom_name | Custom name of the diagnostics settings, name will be default if not set. |
string |
"default" |
no |
| dns_config | DNS configuration for the Traffic Manager profile. | object({ |
{ |
no |
| environment | Project environment. | string |
n/a | yes |
| extra_tags | Additional tags to add on resources. | map(string) |
{} |
no |
| location_short | Short string for Azure location. | string |
n/a | yes |
| logs_categories | Log categories to send to destinations. | list(string) |
null |
no |
| logs_destinations_ids | List of destination resources IDs for logs diagnostic destination. Can be Storage Account, Log Analytics Workspace and Event Hub. No more than one of each can be set.If you want to use Azure EventHub as a destination, you must provide a formatted string containing both the EventHub Namespace authorization send ID and the EventHub name (name of the queue to use in the Namespace) separated by the | character. |
list(string) |
n/a | yes |
| logs_metrics_categories | Metrics categories to send to destinations. | list(string) |
null |
no |
| max_return | The amount of endpoints to return for DNS queries to this Profile. | number |
null |
no |
| monitor_config | Monitor configuration for the Traffic Manager profile. | object({ |
{ |
no |
| name_prefix | Optional prefix for the generated name. | string |
"" |
no |
| name_suffix | Optional suffix for the generated name. | string |
"" |
no |
| profile_status | Whether to enable the profile. Possible values are Enabled or Disabled. |
string |
"Enabled" |
no |
| resource_group_name | Name of the resource group. | string |
n/a | yes |
| stack | Project stack name. | string |
n/a | yes |
| traffic_routing_method | Specify which routing method is preferred between the following: Geographic, Performance, Priority, Weighted, MultiValue, Subnet. |
string |
"Performance" |
no |
| traffic_view_enabled | Whether Traffic View is enabled for the Traffic Manager profile. | bool |
false |
no |
| Name | Description |
|---|---|
| fqdn | Traffic Manager FQDN. |
| id | Traffic Manager ID. |
| module_diagnostics | Diagnostics settings module output. |
| name | Traffic Manager name. |
| resource | Traffic Manager output object. |
Microsoft Azure documentation: xxxx