-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.tf
74 lines (66 loc) · 1.71 KB
/
init.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "2.64.0"
}
}
}
variable "subscription_id" {
type = string
description = "Azure subscription id"
}
variable "tenant_id" {
type = string
description = "Azure tenant id"
}
provider "azurerm" {
subscription_id = var.subscription_id
tenant_id = var.tenant_id
features {
key_vault {
purge_soft_delete_on_destroy = true
}
}
}
resource "azurerm_resource_group" "example" {
name = "example"
location = "eastus"
}
locals {
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
}
module "vnet" {
source = "./azure/vnet"
vnet_name = "example-vnet"
location = local.location
resource_group_name = local.resource_group_name
vnet_address_space = ["10.0.0.0/16"]
}
module "subnet" {
source = "./azure/subnet"
subnets = {
frontend = {
name = "appgw-frontend"
address_prefixes = ["10.0.1.0/24"]
service_endpoints = ["Microsoft.KeyVault"]
}
backend = {
name = "appgw-backend"
address_prefixes = ["10.0.2.0/24"]
service_endpoints = ["Microsoft.Storage"]
}
}
resource_group_name = local.resource_group_name
vnet_name = module.vnet.vnet_name
}
module "appgw" {
source = "./azure/appgw"
appgw_name = "example-appgw"
vnet_name = module.vnet.vnet_name
resource_group_name = local.resource_group_name
location = local.location
frontend_subnet_id = module.subnet.subnet_ids.appgw_frontend
domain_name_label = "example-appgw"
}