-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path01_main.tf
39 lines (34 loc) · 1013 Bytes
/
01_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
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">= 3.46"
}
}
required_version = ">= 1.0"
backend "azurerm" {}
}
provider "azurerm" {
subscription_id = var.subscription_id
features {}
}
resource "azurerm_resource_group" "rg" {
name = var.function_app
location = var.location
tags = var.tags
}
# Network configuration
resource "azurerm_virtual_network" "vnet" {
name = lower(replace(var.function_app, "-", ""))
address_space = ["10.0.0.0/16"]
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
tags = var.tags
}
resource "azurerm_subnet" "subnet" {
name = lower(replace(var.function_app, "-", ""))
resource_group_name = azurerm_resource_group.rg.name
virtual_network_name = azurerm_virtual_network.vnet.name
address_prefixes = ["10.0.1.0/24"]
service_endpoints = ["Microsoft.Storage"]
}