-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathmain.tf
55 lines (49 loc) · 1.77 KB
/
main.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
resource "azurerm_resource_group" "rg" {
name = local.workspace_id
location = "Spain Central"
tags = {
"Origin" = "GitHub"
"Project" = "Azure Terraform Modules (aztfm)"
"Repository" = "terraform-azurerm-application-gateway"
}
}
resource "azurerm_web_application_firewall_policy" "waf" {
name = local.workspace_id
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
tags = azurerm_resource_group.rg.tags
managed_rules {
managed_rule_set {
type = "OWASP"
version = "3.2"
}
}
}
resource "azurerm_virtual_network" "vnet" {
name = local.workspace_id
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
tags = azurerm_resource_group.rg.tags
address_space = ["10.0.0.0/24"]
}
resource "azurerm_subnet" "snet" {
name = local.workspace_id
resource_group_name = azurerm_virtual_network.vnet.resource_group_name
virtual_network_name = azurerm_virtual_network.vnet.name
address_prefixes = ["10.0.0.0/24"]
}
resource "azurerm_public_ip" "pip" {
name = local.workspace_id
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
tags = azurerm_resource_group.rg.tags
zones = [1, 2, 3]
allocation_method = "Static"
sku = "Standard"
}
resource "azurerm_user_assigned_identity" "id" {
name = "${local.workspace_id}1"
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
tags = azurerm_resource_group.rg.tags
}