-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhub.tf
42 lines (38 loc) · 1.37 KB
/
hub.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
# create 'hub' resources
resource "azurerm_resource_group" "hub_rg" {
name = "rg_hub"
location = var.hub_location
tags = {
Owner = var.hub_resource_owner
}
}
resource "azurerm_virtual_network" "hub_vnet" {
name = "vnet_hub"
address_space = [var.hub_vnet_cidr]
location = azurerm_resource_group.hub_rg.location
resource_group_name = azurerm_resource_group.hub_rg.name
}
resource "azurerm_subnet" "hub_fw_subnet" {
name = "AzureFirewallSubnet"
resource_group_name = azurerm_resource_group.hub_rg.name
virtual_network_name = azurerm_virtual_network.hub_vnet.name
address_prefix = var.hub_fw_subnet_cidr
service_endpoints = ["Microsoft.Storage"]
}
resource "azurerm_public_ip" "hub_fw_publicip" {
name = "hub_fw_publicip"
location = azurerm_resource_group.hub_rg.location
resource_group_name = azurerm_resource_group.hub_rg.name
allocation_method = "Static"
sku = "Standard"
}
resource "azurerm_firewall" "hub_fw" {
name = "hub_fw"
location = azurerm_resource_group.hub_rg.location
resource_group_name = azurerm_resource_group.hub_rg.name
ip_configuration {
name = "configuration"
subnet_id = azurerm_subnet.hub_fw_subnet.id
public_ip_address_id = azurerm_public_ip.hub_fw_publicip.id
}
}