forked from krishcool/test1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
blob.tf
42 lines (36 loc) · 1.07 KB
/
blob.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
# Set the Azure Provider source and version being used
terraform {
required_version = ">= 0.14"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.1.0"
}
}
}
# Configure the Microsoft Azure provider
provider "azurerm" {
features {}
}
# Create a Resource Group if it doesn’t exist
resource "azurerm_resource_group" "tfexample" {
name = "my-terraform-rg"
location = "West Europe"
}
# Create a Storage account
resource "azurerm_storage_account" "terraform_state" {
name = var.storage_account_name
resource_group_name = azurerm_resource_group.tfexample.name
location = azurerm_resource_group.tfexample.location
account_tier = "Standard"
account_replication_type = "LRS"
tags = {
environment = "my-terraform-env"
}
}
# Create a Storage container
resource "azurerm_storage_container" "terraform_state" {
name = var.container_name
storage_account_name = azurerm_storage_account.terraform_state.name
container_access_type = "private"
}