A Terraform module for creating
Azure storage container
resources.
.
To use this module you need the following resources:
This module creates a Azure storage container
resources and Azure storage account
resource if needed.
Most basic usage creating a Azure storage container
resource and Azure storage account
.
module "container" {
source = "."
account_id = azurerm_storage_account.account.id
account_name = azurerm_storage_account.account.name
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
environment = "development"
container_name = "container"
container_access_type = "private"
tags = {
environment = "Demo"
}
}
Creating a Azure storage container
resource and Azure storage account
and also an Azure Storage Account
module "container" {
source = "."
account_name = "accountsample"
account_kind = "StorageV2"
account_tier = "Standard"
account_replication_type = "GRS"
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
environment = "development"
container_name = "container"
container_access_type = "private"
tags = {
environment = "Demo"
}
}
See variables.tf
in addition of all arguments above the following attributes are exported by the module:
storage_account_id
: The id of the created storage account returned byAzure Storage Account
id
attributestorage_account_name
: The name of the created storage account returned byAzure Storage Account
name
attributestorage_container_id
: The id of the created storage container returned byAzure Storage Container
id
attributestorage_container_name
: The name of the created storage account returned byAzure Storage Container
name
attribute
You have the samples in samples folder