-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSubnets.tf
More file actions
25 lines (20 loc) · 924 Bytes
/
Copy pathSubnets.tf
File metadata and controls
25 lines (20 loc) · 924 Bytes
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
//3 subnet included in this file, Web subnet, App subnet and DB subnet
resource "azurerm_subnet" "web_subnet" {
name = var.web_sub_name
resource_group_name = azurerm_resource_group.rg.name
virtual_network_name = azurerm_virtual_network.MainVnet.name
address_prefixes = var.web_sub_address
}
resource "azurerm_subnet" "app_subnet" {
name = var.app_sub_name
resource_group_name = azurerm_resource_group.rg.name
virtual_network_name = azurerm_virtual_network.MainVnet.name
address_prefixes = var.app_sub_address
service_endpoints = [ "Microsoft.Sql" ] //Enabled service endpoint for SQL Database to allow secure access from the app subnet
}
resource "azurerm_subnet" "database_subnet" {
name = var.db_sub_name
resource_group_name = azurerm_resource_group.rg.name
virtual_network_name = azurerm_virtual_network.MainVnet.name
address_prefixes = var.db_sub_address
}