Description: Here I have explained, How to setup Storage Account in Azure using Terraform
- Create terraform project file for storage account as follow and save as Storage.tf
variable "storage_account_name" { type=string default="servertechstorage" } variable "resource_group_name" { type=string default="DevOPS1" } provider "azurerm"{ version = "=2.0" subscription_id = "XXXXX-XXXX-XXXX-XXX-XXXXXX" tenant_id = "XXXXXX-XXXX-XXXX-XXXX-XXXXXX"features {} } resource "azurerm_resource_group" "grp" { name = var.resource_group_name location = "East US" } resource "azurerm_storage_account" "store" { name = var.storage_account_name resource_group_name = azurerm_resource_group.grp.name location = azurerm_resource_group.grp.location account_tier = "Standard" account_replication_type = "LRS" }
Here,
Resource Group Name: DevOPS1
StorageAccount Name: servertechstorage
Subscription_id: Subscription id of Your Azure Account
tenant_id: Tenant ID of Your Azure Account
You can add or remove variables and values as per your requirement
- Verify Terraform version by using terraform --version command
No comments:
Post a Comment