Last active
July 12, 2018 16:25
-
-
Save stephenweinrich/04038192458f71ba4b872e1cb1834ee3 to your computer and use it in GitHub Desktop.
traffic manager
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create Traffic Manager API Profile | |
resource "azurerm_traffic_manager_profile" "traffic-manager" { | |
name = "tm-global-contoso-${var.environment}" | |
resource_group_name = "${azurerm_resource_group.resource-group-global.name}" | |
traffic_routing_method = "Performance" | |
dns_config { | |
relative_name = "tm-global-contoso-${var.environment}" | |
ttl = 300 | |
} | |
monitor_config { | |
protocol = "http" | |
port = 80 | |
path = "/" | |
} | |
} | |
# Create Traffic Manager - West End Point | |
resource "azurerm_traffic_manager_endpoint" "tm-endpoint-west" { | |
name = "Gateway West" | |
resource_group_name = "${azurerm_resource_group.resource-group-global.name}" | |
profile_name = "${azurerm_traffic_manager_profile.traffic-manager.name}" | |
type = "externalEndpoints" | |
target = "${azurerm_public_ip.pip_west.fqdn}" | |
endpoint_location = "${azurerm_public_ip.pip_west.location}" | |
} | |
# Create Traffic Manager - East End Point | |
resource "azurerm_traffic_manager_endpoint" "tm-endpoint-east" { | |
name = "Gateway East" | |
resource_group_name = "${azurerm_resource_group.resource-group-global.name}" | |
profile_name = "${azurerm_traffic_manager_profile.traffic-manager.name}" | |
type = "externalEndpoints" | |
target = "${azurerm_public_ip.pip_east.fqdn}" | |
endpoint_location = "${azurerm_public_ip.pip_east.location}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment