Skip to content

A Terraform module that manages the storage resources from the azurerm provider.

License

Notifications You must be signed in to change notification settings

telekom-mms/terraform-azurerm-storage

Repository files navigation

storage

This module manages the hashicorp/azurerm storage resources. For more information see https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs > storage

<-- This file is autogenerated, please do not change. -->

Requirements

Name Version
terraform >=1.3
azurerm >=3.46.0, <4.0

Providers

Name Version
azurerm >=3.46.0, <4.0

Resources

Name Type
azurerm_storage_account.storage_account resource
azurerm_storage_container.storage_container resource
azurerm_storage_share.storage_share resource
azurerm_storage_share_directory.storage_share_directory resource

Inputs

Name Description Type Default Required
storage_account Resource definition, default settings are defined within locals and merged with var settings. For more information look at Outputs. any {} no
storage_container Resource definition, default settings are defined within locals and merged with var settings. For more information look at Outputs. any {} no
storage_share Resource definition, default settings are defined within locals and merged with var settings. For more information look at Outputs. any {} no
storage_share_directory Resource definition, default settings are defined within locals and merged with var settings. For more information look at Outputs. any {} no

Outputs

Name Description
storage_account Outputs all attributes of resource_type.
storage_container Outputs all attributes of resource_type.
storage_share Outputs all attributes of resource_type.
storage_share_directory Outputs all attributes of resource_type.
variables Displays all configurable variables passed by the module. default = predefined values per module. merged = result of merging the default values and custom values passed to the module

Examples

Minimal configuration to install the desired resources with the module

module "storage" {
  source = "registry.terraform.io/telekom-mms/storage/azurerm"
  storage_account = {
    stmms = {
      location            = "westeurope"
      resource_group_name = "rg-mms-github"
    }
  }
  storage_container = {
    terraform = {
      storage_account_name = module.storage.storage_account["stmms"].name
    }
  }
  storage_share = {
    share-mms = {
      storage_account_name = module.storage.storage_account["stmms"].name
      quota                = 5
    }
  }
  storage_share_directory = {
    files = {
      storage_account_name = module.storage.storage_account["stmms"].name
      share_name           = module.storage.storage_share["share-mms"].name
    }
  }
}

Advanced configuration to install the desired resources with the module

module "network" {
  source = "registry.terraform.io/telekom-mms/network/azurerm"
  virtual_network = {
    vn-app-mms = {
      location            = "westeurope"
      resource_group_name = "rg-mms-github"
      address_space       = ["173.0.0.0/23"]
    }
  }
  subnet = {
    snet-app-mms = {
      resource_group_name  = module.network.virtual_network["vn-app-mms"].resource_group_name
      address_prefixes     = ["173.0.0.0/23"]
      virtual_network_name = module.network.virtual_network["vn-app-mms"].name
      service_endpoints    = ["Microsoft.Storage"]
    }
  }
}

module "storage" {
  source = "registry.terraform.io/telekom-mms/storage/azurerm"
  storage_account = {
    stmms = {
      location            = "westeurope"
      resource_group_name = "rg-mms-github"
      network_rules = {
        ip_rules                   = ["172.0.0.2"]
        virtual_network_subnet_ids = [module.network.subnet["snet-app-mms"].id]
      }
      tags = {
        project     = "mms-github"
        environment = terraform.workspace
        managed-by  = "terraform"
      }
    }
  }
  storage_container = {
    terraform = {
      storage_account_name = module.storage.storage_account["stmms"].name
    }
  }
  storage_share = {
    share-mms = {
      storage_account_name = module.storage.storage_account["stmms"].name
      quota                = 5
    }
  }
  storage_share_directory = {
    files = {
      storage_account_name = module.storage.storage_account["stmms"].name
      share_name           = module.storage.storage_share["share-mms"].name
    }
  }
}