Skip to content

Commit

Permalink
added frontdoor and dnszone modules
Browse files Browse the repository at this point in the history
  • Loading branch information
abhilash-keloth committed Dec 15, 2020
1 parent 1f5960f commit ff03fd3
Show file tree
Hide file tree
Showing 7 changed files with 207 additions and 162 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,40 @@ front_doors = {
resource_group_key = "front_door_region1"
certificate_name_check = false

routing_rule = {
name = "ExampleRouteRule1"
accepted_protocols = ["Http", "Https"]
frontend_endpoints = ["exampleFrontendEndpoint1"]
forwarding_protocol = "MatchRequest"
backend_pool_name = "exampleBackendBing"
# routing_rule = {
# name = "ExampleRouteRule1"
# accepted_protocols = ["Http", "Https"]
# frontend_endpoints = ["exampleFrontendEndpoint1"]
# forwarding_protocol = "MatchRequest"
# backend_pool_name = "exampleBackendBing"

# }

routing_rule = {
rr1 = {
name = "exampleRoutingRule1"
frontend_endpoints = ["exampleFrontendEndpoint1"]
accepted_protocols = ["Http", "Https"]
patterns_to_match = ["/*"]
enabled = true
configuration = "Forwarding"
forwarding_configuration = {
backend_pool_name = "exampleBackendBing1"
cache_enabled = false
cache_use_dynamic_compression = false
cache_query_parameter_strip_directive = "StripNone"
custom_forwarding_path = ""
forwarding_protocol = "MatchRequest"
}
redirect_configuration = {
custom_host = ""
redirect_protocol = "MatchRequest"
redirect_type = "Found"
custom_fragment = ""
custom_path = ""
custom_query_string = ""
}
}
}

# Following optional argument can be used to set a time out value between 0-240. If not passed, by default it will be set to 60
Expand All @@ -38,29 +65,95 @@ front_doors = {
# friendly_name = "ExampleFriendDoor"

backend_pool_load_balancing = {
name = "exampleLoadBalancingSettings1"

lb1 = {
name = "exampleLoadBalancingSettings1"
sample_size = 4
successful_samples_required = 2
additional_latency_milliseconds = 0
}
}

backend_pool_health_probe = {
name = "exampleHealthProbeSetting1"
hp1 = {
name = "exampleHealthProbeSetting1"
path = "/"
protocol = "Http"
interval_in_seconds = 120
}
}

# backend_pool_load_balancing = {
# name = "exampleLoadBalancingSettings1"

# }

# backend_pool_health_probe = {
# name = "exampleHealthProbeSetting1"
# }

# backend_pool = {
# name = "exampleBackendBing"
# host_header = "www.bing.com"
# address = "www.bing.com"
# http_port = 80
# https_port = 443
# load_balancing_name = "exampleLoadBalancingSettings1"
# health_probe_name = "exampleHealthProbeSetting1"
# }

backend_pool = {
name = "exampleBackendBing"
host_header = "www.bing.com"
address = "www.bing.com"
http_port = 80
https_port = 443
load_balancing_name = "exampleLoadBalancingSettings1"
health_probe_name = "exampleHealthProbeSetting1"
bp1 = {
name = "exampleBackendBing1"
load_balancing_name = "exampleLoadBalancingSettings1"
health_probe_name = "exampleHealthProbeSetting1"
backend = {
be1 = {
enabled = true
address = "www.bing.com"
host_header = "www.bing.com"
http_port = 80
https_port = 443
priority = 1
weight = 50
},
be2 = {
enabled = true
address = "www.bing.co.uk"
host_header = "www.bing.co.uk"
http_port = 80
https_port = 443
priority = 1
weight = 50
}
}

}
}

# frontend_endpoint = {
# name = "exampleFrontendEndpoint1"
# host_name = "randomabcxyz-FrontDoor.azurefd.net"
# custom_https_provisioning_enabled = false
# }

frontend_endpoint = {
name = "exampleFrontendEndpoint1"
host_name = "randomabcxyz-FrontDoor.azurefd.net"
custom_https_provisioning_enabled = false
}
fe1 = {
name = "exampleFrontendEndpoint1"
host_name = "randomabcxyz-FrontDoor.azurefd.net"
session_affinity_enabled = false
session_affinity_ttl_seconds = 0
custom_https_provisioning_enabled = false
#Required if custom_https_provisioning_enabled is true
custom_https_configuration = {
certificate_source = "FrontDoor"
#If certificate source is AzureKeyVault the below are required:
azure_key_vault_certificate_vault_id = ""
azure_key_vault_certificate_secret_name = ""
azure_key_vault_certificate_secret_version = ""
}
web_application_firewall_policy_link_name = ""
}
}

}
}

This file was deleted.

2 changes: 1 addition & 1 deletion front_doors.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ module "front_doors" {
location = lookup(each.value, "region", null) == null ? module.resource_groups[each.value.resource_group_key].location : local.global_settings.regions[each.value.region]
resource_group_name = module.resource_groups[each.value.resource_group_key].name
base_tags = try(local.global_settings.inherit_tags, false) ? module.resource_groups[each.value.resource_group_key].tags : {}
tags = try(local.global_settings.inherit_tags, false) ? merge(module.resource_groups[each.value.resource_group_key].tags, try(each.value.tags, null)) : try(each.value.tags, null)

}
2 changes: 1 addition & 1 deletion modules/networking/dns_zone/dns_zone.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ resource "azurerm_management_lock" "lock_domain" {
}

resource "azurerm_dns_cname_record" "cname_records" {
for_each = try(var.records.cname_records, {})
for_each = try(var.settings.records.cname_records, {})

name = each.value.name
zone_name = azurerm_dns_zone.domain_zone.name
Expand Down
Loading

0 comments on commit ff03fd3

Please sign in to comment.