Skip to content

padok-team/terraform-azurerm-frontdoor

Repository files navigation

AZURE FRONTDOOR Terraform module

Terraform module which creates FRONTDOOR resources on AZURE.

User Stories for this module

  • AAOPS I can handle the incoming trafic to Azure
  • AAOPS I can enforce HTTP to HTTPS redirections

Usage

module "frontdoor" {
  source = "[email protected]:padok-team/terraform-azurerm-frontdoor.git?ref=v0.1.0"

  name                = "padokexamplefrontdoor"
  resource_group_name = <your resource group name>

  backend_pools = [{
    name = "example-backendpool"
    backends = [{
      enabled     = true
      address     = "padok.fr"
      host_header = "padok.fr"
      http_port   = 80
      https_port  = 443

      priority = null
      weight   = null
    }]
    load_balancing_name = "example-load-balancing"
    health_probe_name   = "example-health-probe"
  }]

  backend_pool_health_probes = [{
    name    = "example-health-probe"
    enabled = false

    path                = null
    protocol            = null
    probe_method        = null
    interval_in_seconds = null
  }]

  backend_pool_load_balancings = [{
    name = "example-load-balancing"

    sample_size                     = null
    successful_samples_required     = null
    additional_latency_milliseconds = null
  }]

  enforce_backend_pools_certificate_name_check = false

  friendly_name = "MyExampleFrontDoor"

  frontend_endpoints = [{
    name      = "example-frontendendpoint"
    host_name = "padokexamplefrontdoor.azurefd.net"

    session_affinity_enabled                = null
    session_affinity_ttl_seconds            = null
    web_application_firewall_policy_link_id = null
  }]

  routing_rules = [{
    name               = "example-routingrule"
    frontend_endpoints = ["example-frontendendpoint"]
    accepted_protocols = ["Http", "Https"]
    patterns_to_match  = ["/*"]
    enabled            = true
    forwarding_configuration = {
      backend_pool_name   = "example-backendpool"
      cache_enabled       = false
      forwarding_protocol = "MatchRequest"

      cache_use_dynamic_compression         = null
      cache_query_parameter_strip_directive = null
      cache_query_parameters                = null
      cache_duration                        = null
      custom_forwarding_path                = null
    }

    redirect_configuration = null
  }]

  tags = {
    terraform = "true"
    padok     = "library"
  }

}

Examples

Modules

No modules.

Inputs

Name Description Type Default Required
backend_pool_health_probes A list of the backend pool health probes.
list(object({
name = string
enabled = bool
path = string
protocol = string
probe_method = string
interval_in_seconds = number
}))
n/a yes
backend_pool_load_balancings A list of the backend pool load balancing.
list(object({
name = string
sample_size = number
successful_samples_required = number
additional_latency_milliseconds = number
}))
n/a yes
backend_pools A list of backend pools.
list(object({
name = string
backends = list(object({
enabled = bool
address = string
host_header = string
http_port = number
https_port = number
priority = number
weight = number
}))
load_balancing_name = string
health_probe_name = string
}))
n/a yes
name The name of the Front Door. string n/a yes
resource_group_name The name of the resource group where the Frontdoor should be created. string n/a yes
backend_pools_send_receive_timeout_seconds Timeout on forwarding request to the backend. number 60 no
enforce_backend_pools_certificate_name_check Enforce certificate name check on HTTPS for all backend pools. bool true no
friendly_name A friendly name for the Frontdoor. string null no
frontend_endpoints A list of frontend endpoints to configure.
list(object({
name = string
host_name = string
session_affinity_enabled = bool
session_affinity_ttl_seconds = number
web_application_firewall_policy_link_id = string
}))
null no
load_balancer_enabled Should the Frontdoor load balancer be enabled ? bool true no
routing_rules A list of routing rules.
list(object({
name = string
frontend_endpoints = list(string)
accepted_protocols = list(string)
patterns_to_match = list(string)
enabled = bool
forwarding_configuration = object({
backend_pool_name = string
cache_enabled = bool
cache_use_dynamic_compression = bool
cache_query_parameter_strip_directive = string
cache_query_parameters = list(string)
cache_duration = number
custom_forwarding_path = string
forwarding_protocol = string
})
redirect_configuration = object({
custom_host = string
redirect_protocol = string
redirect_type = string
custom_fragment = string
custom_path = string
custom_query_string = string
})
}))
null no
tags A mapping of tags associated to the resource. map(string)
{
"terraform": "true"
}
no

Outputs

Name Description
this The Frontdoor resource.

License

License

See LICENSE for full details.

Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

  https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.