Azure Storage Account Terraform Module

Terraform Module to create an Azure storage account with a set of containers, set of file shares (and quota), tables, and queues.

Resources

Example Usage

module "storage" {
  source = "app.terraform.io/Seagen/storage/azurerm"
  version = "x.x.x"

  resource_group_name  = azurerm_resource_group.rg.name
  location             = azurerm_resource_group.rg.location
  storage_account_name = "mystorage"
  containers           = ["container01", "container02", "container03"]

  file_shares = [
    { name = "smbfileshare1", quota = 150 },
    { name = "smbfileshare2", quota = 250 }
  ]

  tables = ["table1", "table2"]
  queues = ["queue1", "queue2"]

  tags = local.tags
}

Storage Account

An Azure storage account contains all of your Azure Storage data objects: blobs, file shares, queues, tables, and disks. The storage account provides a unique namespace for your Azure Storage data that’s accessible from anywhere in the world over HTTP or HTTPS. Data in your storage account is durable and highly available, secure, and massively scalable.

This module creates the storage account based on your input.

The following settings are hard-coded:

Argument

Setting

account_kind

StorageV2

account_tier

Standard

enable_https_traffic_only

true

min_tls_version

TLS1_2

allow_blob_public_access

false

Containers

A container organizes a set of blobs, similar to a directory in a file system. A storage account can include an unlimited number of containers, and a container can store an unlimited number of blobs. The container name must be lowercase.

This module creates the containers based on your input within an Azure Storage Account.

The following settings are hard-coded:

Argument

Setting

container_access_type

private

SMB File Shares

Azure Files offers fully managed file shares in the cloud that are accessible via the industry standard Server Message Block (SMB) protocol. Azure file shares can be mounted concurrently by cloud or on-premises deployments of Windows, Linux, and macOS.

This module creates the SMB file shares based on your input within an Azure Storage Account. Configure the quota for this file share as per your preference. The maximum size of the share, in gigabytes. For Standard storage accounts, this must be greater than 0 and less than 5120 GB (5 TB). For Premium FileStorage storage accounts, this must be greater than 100 GB and less than 102400 GB (100 TB).

Inputs

Name

Description

Type

Default

resource_group_name

The name of the resource group in which resources are created

string

""

location

The location of the resource group in which resources are created

string

""

access_tier

Defines the access tier for StorageV2 accounts. Valid options are Hot and Cool.

string

"Hot"

blob_soft_delete_retention_days

Specifies the number of days that the blob should be retained, between 1 and 365 days.

number

21

container_soft_delete_retention_days

Specifies the number of days that the blob should be retained, between 1 and 365 days.

number

21

enable_versioning

Is versioning enabled?

string

false

last_access_time_enabled

Is the last access time based tracking enabled?

string

false

change_feed_enabled

Is the blob service properties for change feed events enabled?

string

false

containers

List of containers

list

[]

file_shares

List of SMB file shares

list

[]

queues

List of storages queues

list

[]

tables

List of storage tables

list

[]

Tags

A map of tags to add to all resources

map

{}

Container objects

Name

Description

Type

Default

name

Name of the container

string

""

SMB file Shares objects

Name

Description

Type

Default

name

Name of the SMB file share

string

""

quota

The required size in GB.

string

""

Outputs

Name

Description

storage_account_id

The ID of the storage account

storage_account_name

The name of the storage account

storage_primary_connection_string

The primary connection string for the storage account

storage_primary_access_key

The primary access key for the storage account

storage_secondary_access_key

The secondary access key for the storage account

containers

The list of containers

file_shares

The list of SMB file shares

tables

The list of storage tables

queues

The list of storage queues