-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmain.tf
49 lines (43 loc) · 1.12 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
provider "azurerm" {
features {}
}
# Variables
variable "location" {
type = string
}
variable "applicationResourceName" {
type = string
}
variable "managedResourceGroupId" {
type = string
}
variable "email" {
type = string
}
# Create a resource group if it doesn't exist
resource "azurerm_resource_group" "myterraformgroup" {
name = "myterraformgroup"
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({
"location" = {
value = var.location
},
"applicationResourceName" = {
value = var.applicationResourceName
},
"managedResourceGroupId" = {
value = var.managedResourceGroupId
},
"email" = {
value = var.email
}
})
// Source ARM template from file in another folder
template_content = file("../managedapp-arm/managedapp-arm.json")
}