-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
55 lines (45 loc) · 1.27 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
# Define variables. Credentials and identifiers are loaded from terraform.tfvars
variable "subscription_id" {
}
variable "client_id" {
}
variable "client_secret" {
}
variable "tenant_id" {
}
variable "prefix" {
}
variable "location" {
default = "Japan West"
}
# Configure the Azure Resource Manager Provider
provider "azurerm" {
subscription_id = "${var.subscription_id}"
client_id = "${var.client_id}"
client_secret = "${var.client_secret}"
tenant_id = "${var.tenant_id}"
}
# Create a resource group
resource "azurerm_resource_group" "terraform_sample" {
name = "terraform_sample"
location = "${var.location}"
}
# Create a virtual network
module "network" {
source = "./network"
resource_group_name = "${azurerm_resource_group.terraform_sample.name}"
location = "${var.location}"
}
# Create a storage
module "storage" {
source = "./storage"
resource_group_name = "${azurerm_resource_group.terraform_sample.name}"
location = "${var.location}"
prefix = "${var.prefix}"
}
# Create an avalability set
module "avalability_set" {
source = "./availability_set"
resource_group_name = "${azurerm_resource_group.terraform_sample.name}"
location = "${var.location}"
}