Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

289 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Traffic Manager

Changelog Notice Apache V2 License OpenTofu Registry

Azure module to deploy a Traffic Manager.

Global versioning rule for Claranet Azure modules

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

Contributing

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.

Usage

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.

⚠️ Since modules version v8.0.0, we do not maintain/check anymore the compatibility with Hashicorp Terraform. Instead, we recommend to use OpenTofu.

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"
  }
}

Providers

Name Version
azurecaf ~> 1.3.0
azurerm ~> 4.31

Modules

Name Source Version
diagnostics claranet/diagnostic-settings/azurerm ~> 8.2

Resources

Name Type
azurerm_traffic_manager_profile.main resource
azurecaf_name.traffic_manager data source

Inputs

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({
relative_name = string
ttl = number
})
{
"relative_name": "",
"ttl": 30
}
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({
protocol = string
port = number
path = optional(string)
expected_status_code_ranges = optional(list(string))
custom_header = optional(list(object({
name = string
value = string
})))
interval_in_seconds = optional(number)
timeout_in_seconds = optional(number)
tolerated_number_of_failures = optional(number)
})
{
"custom_header": null,
"expected_status_code_ranges": [],
"interval_in_seconds": 30,
"port": 22,
"protocol": "TCP",
"timeout_in_seconds": 10,
"tolerated_number_of_failures": 3
}
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

Outputs

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.

Related documentation

Microsoft Azure documentation: xxxx

About

Terraform module for Azure Traffic Manager

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages