forked from ned1313/tfc-azure-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
42 lines (34 loc) · 933 Bytes
/
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
variable "prefix" {
type = string
description = "(Required) Naming prefix for resources."
}
variable "address_space" {
type = string
description = "(Optional) Address space for virtual network, defaults to 10.0.0.0/16."
default = "10.0.0.0/16"
}
variable "location" {
type = string
description = "(Optional) Region for Azure resources, defaults to East US."
default = "eastus"
}
locals {
base_name = "${var.prefix}web"
change = "trigger-4"
}
resource "azurerm_resource_group" "web" {
name = local.base_name
location = var.location
tags = {
"environment" = var.prefix
}
}
resource "azurerm_virtual_network" "web" {
name = local.base_name
resource_group_name = azurerm_resource_group.web.name
location = azurerm_resource_group.web.location
address_space = [var.address_space]
tags = {
"environment" = var.prefix
}
}