Skip to content

Commit 12f32c7

Browse files
authored
Merge pull request #1 from kumarvna/develop
Final configuration for version 1.0
2 parents ce61cc5 + 1dae43e commit 12f32c7

File tree

14 files changed

+1535
-2
lines changed

14 files changed

+1535
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# .tfstate files
55
*.tfstate
66
*.tfstate.*
7+
*.terraform.lock.hcl
78

89
# Crash log files
910
crash.log

README.md

Lines changed: 308 additions & 2 deletions
Large diffs are not rendered by default.

examples/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Azure Front Door Terraform Module
2+
3+
Azure Front Door is a fast, reliable, and secure modern cloud CDN that uses the Microsoft global edge network and integrates with intelligent threat protection. It combines the capabilities of Azure Front Door, Azure Content Delivery Network (CDN) standard, and Azure Web Application Firewall (WAF) into a single secure cloud CDN platform.
4+
5+
This Terraform module helps create Microsoft's highly available and scalable web application acceleration platform and global HTTP(s) load balancer Azure Front Door Service with Web Application Firewall policies and SSL offloading.
6+
7+
## Module Usage for
8+
9+
* [Frontdoor with SSL Offloading](frontdoor_with_custom_https_configuration/)
10+
* [Frontdoor with WAF Policies](frontdoor_with_waf_policies/)
11+
12+
## Terraform Usage
13+
14+
To run this example you need to execute following Terraform commands
15+
16+
```hcl
17+
terraform init
18+
terraform plan
19+
terraform apply
20+
```
21+
22+
Run `terraform destroy` when you don't need these resources.
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Azure Front Door Terraform Module
2+
3+
Azure Front Door is a fast, reliable, and secure modern cloud CDN that uses the Microsoft global edge network and integrates with intelligent threat protection. It combines the capabilities of Azure Front Door, Azure Content Delivery Network (CDN) standard, and Azure Web Application Firewall (WAF) into a single secure cloud CDN platform.
4+
5+
This Terraform module helps create Microsoft's highly available and scalable web application acceleration platform and global HTTP(s) load balancer Azure Front Door Service with Web Application Firewall policies and SSL offloading.
6+
7+
## Module Usage for Frontdoor with SSL offloading
8+
9+
```terraform
10+
# Azurerm Provider configuration
11+
provider "azurerm" {
12+
features {}
13+
}
14+
15+
module "frontdoor" {
16+
source = "kumarvna/frontdoor/azurerm"
17+
version = "1.0.0"
18+
19+
# By default, this module will not create a resource group. Location will be same as existing RG.
20+
# proivde a name to use an existing resource group, specify the existing resource group name,
21+
# set the argument to `create_resource_group = true` to create new resrouce group.
22+
resource_group_name = "rg-shared-westeurope-01"
23+
location = "westeurope"
24+
frontdoor_name = "example-frontdoor51"
25+
26+
routing_rules = [
27+
{
28+
name = "exampleRoutingRule1"
29+
accepted_protocols = ["Http", "Https"]
30+
patterns_to_match = ["/*"]
31+
frontend_endpoints = ["exampleFrontendEndpoint1"]
32+
forwarding_configuration = {
33+
forwarding_protocol = "MatchRequest"
34+
backend_pool_name = "exampleBackendBing"
35+
}
36+
}
37+
]
38+
39+
backend_pool_load_balancing = [
40+
{
41+
name = "exampleLoadBalancingSettings1"
42+
}
43+
]
44+
45+
backend_pool_health_probes = [
46+
{
47+
name = "exampleHealthProbeSetting1"
48+
}
49+
]
50+
51+
backend_pools = [
52+
{
53+
name = "exampleBackendBing"
54+
backend = {
55+
host_header = "www.bing.com"
56+
address = "www.bing.com"
57+
http_port = 80
58+
https_port = 443
59+
}
60+
load_balancing_name = "exampleLoadBalancingSettings1"
61+
health_probe_name = "exampleHealthProbeSetting1"
62+
}
63+
]
64+
65+
# In order to enable the use of your own custom HTTPS certificate you must grant
66+
# Azure Front Door Service access to your key vault. For instuctions on how to
67+
# configure your Key Vault correctly. Please refer to the product documentation.
68+
# https://bit.ly/38FuAZv
69+
70+
frontend_endpoints = [
71+
{
72+
name = "exampleFrontendEndpoint1"
73+
host_name = "example-frontdoor51.azurefd.net"
74+
},
75+
{
76+
name = "exampleFrontendEndpoint2"
77+
host_name = "example-frontdoor52.azurefd.net"
78+
custom_https_configuration = {
79+
certificate_source = "FrontDoor"
80+
}
81+
},
82+
{
83+
name = "exampleFrontendEndpoint3"
84+
host_name = "example-frontdoor53.azurefd.net"
85+
custom_https_configuration = {
86+
certificate_source = "AzureKeyVault"
87+
azure_key_vault_certificate_vault_id = "" # valid keyvalut id
88+
azure_key_vault_certificate_secret_name = "" # valid certificate secret
89+
azure_key_vault_certificate_secret_version = "Latest"
90+
}
91+
}
92+
]
93+
94+
# (Optional) To enable Azure Monitoring for Azure Frontdoor
95+
# (Optional) Specify `storage_account_name` to save monitoring logs to storage.
96+
log_analytics_workspace_name = "loganalytics-we-sharedtest2"
97+
98+
# Adding TAG's to your Azure resources
99+
tags = {
100+
ProjectName = "demo-internal"
101+
Env = "dev"
102+
103+
BusinessUnit = "CORP"
104+
ServiceClass = "Gold"
105+
}
106+
}
107+
```
108+
109+
## Terraform Usage
110+
111+
To run this example you need to execute following Terraform commands
112+
113+
```hcl
114+
terraform init
115+
terraform plan
116+
terraform apply
117+
```
118+
119+
Run `terraform destroy` when you don't need these resources.
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Azurerm Provider configuration
2+
provider "azurerm" {
3+
features {}
4+
}
5+
6+
module "frontdoor" {
7+
source = "kumarvna/frontdoor/azurerm"
8+
version = "1.0.0"
9+
10+
# By default, this module will not create a resource group. Location will be same as existing RG.
11+
# proivde a name to use an existing resource group, specify the existing resource group name,
12+
# set the argument to `create_resource_group = true` to create new resrouce group.
13+
resource_group_name = "rg-shared-westeurope-01"
14+
location = "westeurope"
15+
frontdoor_name = "example-frontdoor51"
16+
17+
routing_rules = [
18+
{
19+
name = "exampleRoutingRule1"
20+
accepted_protocols = ["Http", "Https"]
21+
patterns_to_match = ["/*"]
22+
frontend_endpoints = ["exampleFrontendEndpoint1"]
23+
forwarding_configuration = {
24+
forwarding_protocol = "MatchRequest"
25+
backend_pool_name = "exampleBackendBing"
26+
}
27+
}
28+
]
29+
30+
backend_pool_load_balancing = [
31+
{
32+
name = "exampleLoadBalancingSettings1"
33+
}
34+
]
35+
36+
backend_pool_health_probes = [
37+
{
38+
name = "exampleHealthProbeSetting1"
39+
}
40+
]
41+
42+
backend_pools = [
43+
{
44+
name = "exampleBackendBing"
45+
backend = {
46+
host_header = "www.bing.com"
47+
address = "www.bing.com"
48+
http_port = 80
49+
https_port = 443
50+
}
51+
load_balancing_name = "exampleLoadBalancingSettings1"
52+
health_probe_name = "exampleHealthProbeSetting1"
53+
}
54+
]
55+
56+
# In order to enable the use of your own custom HTTPS certificate you must grant
57+
# Azure Front Door Service access to your key vault. For instuctions on how to
58+
# configure your Key Vault correctly. Please refer to the product documentation.
59+
# https://bit.ly/38FuAZv
60+
61+
frontend_endpoints = [
62+
{
63+
name = "exampleFrontendEndpoint1"
64+
host_name = "example-frontdoor51.azurefd.net"
65+
},
66+
{
67+
name = "exampleFrontendEndpoint2"
68+
host_name = "example-frontdoor52.azurefd.net"
69+
custom_https_configuration = {
70+
certificate_source = "FrontDoor"
71+
}
72+
},
73+
{
74+
name = "exampleFrontendEndpoint3"
75+
host_name = "example-frontdoor53.azurefd.net"
76+
custom_https_configuration = {
77+
certificate_source = "AzureKeyVault"
78+
azure_key_vault_certificate_vault_id = "" # valid keyvalut id
79+
azure_key_vault_certificate_secret_name = "" # valid certificate secret
80+
azure_key_vault_certificate_secret_version = "Latest"
81+
}
82+
}
83+
]
84+
85+
# (Optional) To enable Azure Monitoring for Azure Frontdoor
86+
# (Optional) Specify `storage_account_name` to save monitoring logs to storage.
87+
log_analytics_workspace_name = "loganalytics-we-sharedtest2"
88+
89+
# Adding TAG's to your Azure resources
90+
tags = {
91+
ProjectName = "demo-internal"
92+
Env = "dev"
93+
94+
BusinessUnit = "CORP"
95+
ServiceClass = "Gold"
96+
}
97+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
output "backend_pool_ids" {
2+
description = "The ID of the Azure Front Door Backend Pool"
3+
value = module.frontdoor.backend_pool_ids
4+
}
5+
6+
output "backend_pool_health_probes" {
7+
description = "The ID's of the Azure Front Door Backend Health Probe"
8+
value = module.frontdoor.backend_pool_health_probes
9+
}
10+
11+
output "backend_pool_load_balancing" {
12+
description = "The ID of the Azure Front Door Backend Load Balancer"
13+
value = module.frontdoor.backend_pool_load_balancing
14+
}
15+
16+
output "frontend_endpoint_id" {
17+
description = "The ID of the Azure Front Door Frontend Endpoint"
18+
value = module.frontdoor.frontend_endpoint_id
19+
}
20+
21+
22+
output "frontdoor_id" {
23+
description = "The ID of the FrontDoor"
24+
value = module.frontdoor.frontdoor_id
25+
}
26+
27+
output "frontdoor_waf_policy_id" {
28+
description = "The ID of the FrontDoor Firewall Policy"
29+
value = module.frontdoor.frontdoor_waf_policy_id
30+
}
31+
32+
output "frontdoor_waf_policy_location" {
33+
description = "The Azure Region where this FrontDoor Firewall Policy exists"
34+
value = module.frontdoor.frontdoor_waf_policy_location
35+
}
36+
37+
output "frontdoor_waf_policy_frontend_endpoint_ids" {
38+
description = "The Frontend Endpoints associated with this Front Door Web Application Firewall policy"
39+
value = module.frontdoor.frontdoor_waf_policy_frontend_endpoint_ids
40+
}

0 commit comments

Comments
 (0)