-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.tf
More file actions
51 lines (43 loc) · 1.36 KB
/
main.tf
File metadata and controls
51 lines (43 loc) · 1.36 KB
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
resource "azurerm_resource_group" "api_rgg" {
name = var.rg_name
location = var.rg_location
}
resource "azurerm_resource_group" "test_rg" {
name = var.test_rg_name
location = "East US"
tags = {
"costcenter" = "101"
"dept" = "finance"
"env" = "test"
}
}
resource "azurerm_virtual_network" "testnetwork" {
location = azurerm_resource_group.test_rg.location
resource_group_name = azurerm_resource_group.test_rg.name
address_space = ["10.0.0.0/19", "192.168.0.0/24"]
name = "vnetwork-provider"
tags = {
"env" = "test"
}
}
resource "azurerm_subnet" "defaultsubnet" {
name = "default"
resource_group_name = azurerm_resource_group.test_rg.name
virtual_network_name = azurerm_virtual_network.testnetwork.name
address_prefixes = ["10.0.0.0/24"]
}
resource "azurerm_subnet" "dbsubnet" {
name = "db"
resource_group_name = azurerm_resource_group.test_rg.name
virtual_network_name = azurerm_virtual_network.testnetwork.name
address_prefixes = ["10.0.2.0/24"]
service_endpoints = [
"Microsoft.Sql"
]
}
resource "azurerm_subnet" "appsubnet" {
name = "app"
resource_group_name = azurerm_resource_group.test_rg.name
virtual_network_name = azurerm_virtual_network.testnetwork.name
address_prefixes = ["10.0.1.0/24"]
}