-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.tf
35 lines (29 loc) · 843 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
variable "resourceGroupName" {}
variable "location" {
default = "southcentralus"
}
variable "storageAccountPrefix" {
default = "packerimages"
}
variable "storageAccountType" {
default = "Standard_GRS"
}
resource "random_id" "storageaccount" {
keepers = {
name = "${var.storageAccountPrefix}"
}
byte_length = 12
}
resource "azurerm_resource_group" "packer" {
name = "${var.resourceGroupName}"
location = "${var.location}"
}
resource "azurerm_storage_account" "packer" {
name = "${format("%.24s", lower("${var.storageAccountPrefix}${random_id.storageaccount.id}"))}"
resource_group_name = "${azurerm_resource_group.packer.name}"
location = "${var.location}"
account_type = "${var.storageAccountType}"
}
output "storage_account_name" {
value = "${azurerm_storage_account.packer.name}"
}