-
Notifications
You must be signed in to change notification settings - Fork 8
/
Storage_Account_Creation.tf
50 lines (40 loc) · 1.06 KB
/
Storage_Account_Creation.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
# Terraform Block
terraform {
required_version = ">= 0.15"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "2.92.0"
}
random = {
source = "hashicorp/random"
version = ">= 3.0"
}
}
}
# Provider Block
provider "azurerm" {
features {}
}
# Resource-1: Azure Resource Group
resource "azurerm_resource_group" "terraformresourcegroup" {
name = "terraform-rg1"
location = "west US"
}
# Resource-2: Random String
resource "random_string" "storageaccountrandomname" {
length = 16
upper = false
special = false
}
# Resource-3: Azure Storage Account
resource "azurerm_storage_account" "terraformsa" {
name = "tfsa${random_string.myrandom.id}"
resource_group_name = azurerm_resource_group.terraformresourcegroup.name
location = azurerm_resource_group.terraformresourcegroup.location
account_tier = "Standard"
account_replication_type = "GRS"
tags = {
Lab = "terraformlab"
}
}