-
Notifications
You must be signed in to change notification settings - Fork 7
/
main.tf
81 lines (70 loc) · 1.52 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
provider "azurerm" {
features {}
}
# Variables
variable "location" {
type = string
}
variable "rgName" {
type = string
}
variable "monitorName" {
type = string
}
variable "firstName" {
type = string
}
variable "lastName" {
type = string
}
variable "companyName" {
type = string
}
variable "emailAddress" {
type = string
}
variable "domain" {
type = string
}
variable "country" {
type = string
}
# Create a resource group if it doesn't exist
resource "azurerm_resource_group" "myterraformgroup" {
name = var.rgName
location = var.location
}
# Create ARM template deployment
resource "azurerm_resource_group_template_deployment" "arm_template" {
name = "terraform_arm_template"
resource_group_name = azurerm_resource_group.myterraformgroup.name
deployment_mode = "Incremental"
parameters_content = jsonencode({
"monitorName" = {
value = var.monitorName
},
"monitorLocation" = {
value = var.location
},
"firstName" = {
value = var.firstName
},
"lastName" = {
value = var.lastName
},
"companyName" = {
value = var.companyName
},
"emailAddress" = {
value = var.emailAddress
},
"domain" = {
value = var.domain
},
"country" = {
value = var.country
}
})
// Source ARM template from file in another folder
template_content = file("../elasticsearch-arm/elasticsearch-arm.json")
}