Skip to content

Commit c7e5e16

Browse files
authored
front door sample
1 parent b7fa00f commit c7e5e16

File tree

3 files changed

+106
-0
lines changed

3 files changed

+106
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# provider.tf
2+
# This file configures the Azure provider to interact with Azure resources.
3+
# It specifies the required provider and its version, along with provider-specific configurations.
4+
5+
terraform {
6+
required_version = ">= 1.8, < 2.0"
7+
# Specify the required provider and its version
8+
required_providers {
9+
azurerm = {
10+
source = "hashicorp/azurerm" # Source of the AzureRM provider
11+
version = "~> 4.16.0" # Version of the AzureRM provider
12+
}
13+
}
14+
}
15+
16+
provider "azurerm" {
17+
features {} # Enable all features for the AzureRM provider
18+
subscription_id = var.subscription_id # Use the subscription ID variable
19+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# terraform.tfvars
2+
# This file provides default values for the variables defined in variables.tf.
3+
# These values can be overridden by specifying different values during Terraform execution.
4+
5+
# Azure Subscription
6+
subscription_id = "" # your-subscription-id
7+
8+
# Resource Group
9+
resource_group_name = "RG-frontdoor-test"
10+
location = "eastus"
11+
12+
# Front Door Configuration
13+
front_door_name = "myfrontdoorprofilebrown"
14+
backend_host = "mybackendtestbrown.example.com"
15+
16+
# Frontend Endpoint Configuration
17+
frontend_endpoint_name = "frontendEndpoint"
18+
19+
# Health Probe Configuration
20+
health_probe_path = "/"
21+
health_probe_protocol = "Http"
22+
23+
# Routing Rule Configuration
24+
routing_rule_name = "routingRule1"
25+
accepted_protocols = ["Http", "Https"]
26+
patterns_to_match = ["/*"]
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# variables.tf
2+
# This file defines the input variables used in the Terraform configuration.
3+
4+
variable "subscription_id" {
5+
description = "The Azure subscription ID"
6+
type = string
7+
}
8+
9+
variable "resource_group_name" {
10+
description = "The name of the resource group"
11+
type = string
12+
}
13+
14+
variable "location" {
15+
description = "The Azure region to deploy resources"
16+
type = string
17+
}
18+
19+
variable "front_door_name" {
20+
description = "The name of the Azure Front Door Standard profile"
21+
type = string
22+
}
23+
24+
variable "backend_host" {
25+
description = "The backend host (FQDN or IP) where Front Door will route traffic"
26+
type = string
27+
}
28+
29+
variable "frontend_endpoint_name" {
30+
description = "The name of the Front Door frontend endpoint"
31+
type = string
32+
}
33+
34+
variable "health_probe_path" {
35+
description = "The path used for health probing"
36+
type = string
37+
default = "/"
38+
}
39+
40+
variable "health_probe_protocol" {
41+
description = "The protocol for health probing (Http or Https)"
42+
type = string
43+
default = "Http"
44+
}
45+
46+
variable "routing_rule_name" {
47+
description = "The name of the routing rule"
48+
type = string
49+
}
50+
51+
variable "accepted_protocols" {
52+
description = "List of accepted protocols for routing"
53+
type = list(string)
54+
default = ["Http", "Https"]
55+
}
56+
57+
variable "patterns_to_match" {
58+
description = "URL patterns for request matching"
59+
type = list(string)
60+
default = ["/*"]
61+
}

0 commit comments

Comments
 (0)