Skip to content

Terraform module to create storage account according to the specified type.

License

Notifications You must be signed in to change notification settings

scalair/terraform-azure-storage-account

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

azurerm_storage_account

Terraform module which creates azure storage account with the ability to manage the following features:

  • Lifecyle rules
  • Network and firewall rules
  • Cross-origin resource sharing

This module is tested with:

  • Azure Provider 2.13.0
  • Terrafrom v0.12.23

It can create the following resources:

  • azurerm_storage_account
  • azurerm_storage_management_policy
  • azurerm_storage_container
  • azurerm_storage_share

Terragrunt instance example is provided below:

inputs = {
  resource_group_name       = "resource_group_name"
  location                  = "Azure_region"
  sa_name                   = "Service_account_name"
  account_kind              = "StorageV2"
  account_tier              = "Standard"
  account_replication_type  = "LRS"
  access_tier               = "Hot"
  is_hns_enabled              = true

  network_rules = [
    {
      default_action              = "Allow"
      bypass                      = ["AzureServices"]
      ip_rules                    = ["IP"]
      virtual_network_subnet_ids  = ["vnet_subnet_id"]
    }
  ]

  containers = [
    {
      name = "container1",
      access_type = "blob"
    }
  ]

  blob_properties_cors_rules    = [
    {
      allowed_headers         = []
      allowed_methods         = ["GET"]
      allowed_origins         = ["https://testfreyu.com"]
      exposed_headers         = []
      max_age_in_seconds      = 47

    }
  ]

  add_lifecycle_rules         = true
  lifcecycle_rules            = [
    {
      name                    = "rule1"
      enabled                 = true
      prefix_match            = []
      blob_types              = ["blockBlob"]
      tier_to_cool_after_days_since_modification_greater_than     = 0
      tier_to_archive_after_days_since_modification_greater_than  = 0
      delete_after_days_since_modification_greater_than           = 5
      delete_snapshot_after_days_since_creation_greater_than  = 5
    }
  ]

  tags = {
     terrafromd   = "true"
  }
}

About

Terraform module to create storage account according to the specified type.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages