Code Monkey home page Code Monkey logo

terraform-azurerm-storage-account's Introduction

Azure Storage Account

Changelog Notice Apache V2 License TF Registry

Common Azure terraform module to create a Storage Account and manage related parameters (Threat protection, Network Rules, Blob Containers, File Shares, etc.)

Azure File share authentication

If you need to enable Active Directory or AAD DS authentication for Azure File on this Storage Account, please read the Microsoft documentation and set the required values in the file_share_authentication variable.

Global versioning rule for Claranet Azure modules

Module version Terraform version AzureRM version
>= 7.x.x 1.3.x >= 3.0
>= 6.x.x 1.x >= 3.0
>= 5.x.x 0.15.x >= 2.0
>= 4.x.x 0.13.x / 0.14.x >= 2.0
>= 3.x.x 0.12.x >= 2.0
>= 2.x.x 0.12.x < 2.0
< 2.x.x 0.11.x < 2.0

Contributing

If you want to contribute to this repository, feel free to use our pre-commit git hook configuration which will help you automatically update and format some files for you by enforcing our Terraform code module best-practices.

More details are available in the CONTRIBUTING.md file.

Usage

This module is optimized to work with the Claranet terraform-wrapper tool which set some terraform variables in the environment needed by this module. More details about variables set by the terraform-wrapper available in the documentation.

data "http" "my_ip" {
  url = "http://ip4.clara.net/?raw"
}

module "azure_region" {
  source  = "claranet/regions/azurerm"
  version = "x.x.x"

  azure_region = var.azure_region
}

module "rg" {
  source  = "claranet/rg/azurerm"
  version = "x.x.x"

  client_name = var.client_name
  environment = var.environment
  location    = module.azure_region.location
  stack       = var.stack
}

module "run" {
  source  = "claranet/run/azurerm"
  version = "x.x.x"

  client_name    = var.client_name
  environment    = var.environment
  location       = module.azure_region.location
  location_short = module.azure_region.location_short
  stack          = var.stack

  monitoring_function_enabled = false

  resource_group_name = module.rg.resource_group_name
}

module "storage_account" {
  source  = "claranet/storage-account/azurerm"
  version = "x.x.x"

  location       = module.azure_region.location
  location_short = module.azure_region.location_short
  client_name    = var.client_name
  environment    = var.environment
  stack          = var.stack

  resource_group_name = module.rg.resource_group_name

  allowed_cidrs = [format("%s/32", data.http.my_ip.body)]

  account_replication_type = "LRS"

  storage_blob_data_protection = {
    change_feed_enabled                       = true
    versioning_enabled                        = true
    delete_retention_policy_in_days           = 42
    container_delete_retention_policy_in_days = 42
    container_point_in_time_restore           = true
  }

  # Disabled by default
  storage_blob_cors_rules = [{
    allowed_headers    = ["*"]
    allowed_methods    = ["GET", "HEAD"]
    allowed_origins    = ["https://example.com"]
    exposed_headers    = ["*"]
    max_age_in_seconds = 3600
  }]

  logs_destinations_ids = [
    module.run.logs_storage_account_id,
    module.run.log_analytics_workspace_id,
  ]

  # Set by default
  queue_properties_logging = {
    delete                = true
    read                  = true
    write                 = true
    version               = "1.0"
    retention_policy_days = 10
  }

  containers = [
    {
      name = "container1"
    },
    {
      name = "container2"
      # container_access_type = "blob"
    }
  ]

  file_shares = [
    {
      name        = "share1smb"
      quota_in_gb = 50
    }
  ]

  tables = [
    {
      name = "table1"
    }
  ]

  queues = [
    {
      name = "queue1"
    }
  ]

  extra_tags = {
    foo = "bar"
  }
}

Providers

Name Version
azurecaf ~> 1.2, >= 1.2.22
azurerm ~> 3.39

Modules

Name Source Version
diagnostics claranet/diagnostic-settings/azurerm ~> 6.5.0
diagnostics_type claranet/diagnostic-settings/azurerm ~> 6.5.0

Resources

Name Type
azurerm_advanced_threat_protection.threat_protection resource
azurerm_storage_account.storage resource
azurerm_storage_account_network_rules.network_rules resource
azurerm_storage_container.container resource
azurerm_storage_queue.queue resource
azurerm_storage_share.share resource
azurerm_storage_table.table resource
azurecaf_name.sa data source

Inputs

Name Description Type Default Required
access_tier Defines the access tier for BlobStorage, FileStorage and StorageV2 accounts. Valid options are Hot and Cool, defaults to Hot. string "Hot" no
account_kind Defines the Kind of account. Valid options are BlobStorage, BlockBlobStorage, FileStorage, Storage and StorageV2. Changing this forces a new resource to be created. Defaults to StorageV2. string "StorageV2" no
account_replication_type Defines the type of replication to use for this Storage Account. Valid options are LRS, GRS, RAGRS, ZRS, GZRS and RAGZRS. string "ZRS" no
account_tier Defines the Tier to use for this Storage Account. Valid options are Standard and Premium. For BlockBlobStorage and FileStorage accounts only Premium is valid. Changing this forces a new resource to be created. string "Standard" no
advanced_threat_protection_enabled Boolean flag which controls if advanced threat protection is enabled, see documentation for more information. bool false no
allowed_cidrs List of CIDR to allow access to that Storage Account. list(string) [] no
client_name Client name/account used in naming string n/a yes
containers List of objects to create some Blob containers in this Storage Account.
list(object({
name = string
container_access_type = optional(string, "private")
metadata = optional(map(string))
}))
[] no
cross_tenant_replication_enabled Enable cross tenant replication. bool false no
custom_diagnostic_settings_name Custom name of the diagnostics settings, name will be 'default' if not set. string "default" no
custom_domain_name The Custom Domain Name to use for the Storage Account, which will be validated by Azure. string null no
default_firewall_action Which default firewalling policy to apply. Valid values are Allow or Deny. string "Deny" no
default_tags_enabled Option to enable or disable default tags. bool true no
environment Project environment string n/a yes
extra_tags Additional tags to associate with your Azure Storage Account. map(string) {} no
file_share_authentication Storage Account file shares authentication configuration.
object({
directory_type = string
active_directory = optional(object({
storage_sid = string
domain_name = string
domain_sid = string
domain_guid = string
forest_name = string
netbios_domain_name = string
}))
})
null no
file_share_cors_rules Storage Account file shares CORS rule. Please refer to the documentation for more information.
object({
allowed_headers = list(string)
allowed_methods = list(string)
allowed_origins = list(string)
exposed_headers = list(string)
max_age_in_seconds = number
})
null no
file_share_properties_smb Storage Account file shares smb properties.
object({
versions = optional(list(string), null)
authentication_types = optional(list(string), null)
kerberos_ticket_encryption_type = optional(list(string), null)
channel_encryption_type = optional(list(string), null)
multichannel_enabled = optional(bool, null)
})
null no
file_share_retention_policy_in_days Storage Account file shares retention policy in days. Enabling this may require additional directory permissions. number null no
file_shares List of objects to create some File Shares in this Storage Account.
list(object({
name = string
quota_in_gb = number
enabled_protocol = optional(string)
metadata = optional(map(string))
acl = optional(list(object({
id = string
permissions = string
start = optional(string)
expiry = optional(string)
})))
}))
[] no
hns_enabled Is Hierarchical Namespace enabled? This can be used with Azure Data Lake Storage Gen 2 and must be true if nfsv3_enabled or sftp_enabled is set to true. Changing this forces a new resource to be created. bool false no
https_traffic_only_enabled Boolean flag which forces HTTPS if enabled. bool true no
identity_ids Specifies a list of User Assigned Managed Identity IDs to be assigned to this Storage Account. list(string) null no
identity_type Specifies the type of Managed Service Identity that should be configured on this Storage Account. Possible values are SystemAssigned, UserAssigned, SystemAssigned, UserAssigned (to enable both). string "SystemAssigned" no
location Azure location string n/a yes
location_short Short string for Azure location string n/a yes
logs_categories Log categories to send to destinations. list(string) null no
logs_destinations_ids List of destination resources IDs for logs diagnostic destination.
Can be Storage Account, Log Analytics Workspace and Event Hub. No more than one of each can be set.
If you want to specify an Azure EventHub to send logs and metrics to, you need to provide a formated string with both the EventHub Namespace authorization send ID and the EventHub name (name of the queue to use in the Namespace) separated by the `
` character. list(string) n/a
logs_metrics_categories Metrics categories to send to destinations. list(string) null no
min_tls_version The minimum supported TLS version for the Storage Account. Possible values are TLS1_0, TLS1_1, and TLS1_2. string "TLS1_2" no
name_prefix Optional prefix for the generated name string "" no
name_suffix Optional suffix for the generated name string "" no
network_bypass Specifies whether traffic is bypassed for 'Logging', 'Metrics', 'AzureServices' or 'None'. list(string)
[
"Logging",
"Metrics",
"AzureServices"
]
no
network_rules_enabled Boolean to enable Network Rules on the Storage Account, requires network_bypass, allowed_cidrs, subnet_ids or default_firewall_action correctly set if enabled. bool true no
nfsv3_enabled Is NFSv3 protocol enabled? Changing this forces a new resource to be created. bool false no
private_link_access List of Privatelink objects to allow access from.
list(object({
endpoint_resource_id = string
endpoint_tenant_id = optional(string, null)
}))
[] no
public_nested_items_allowed Allow or disallow nested items within this Account to opt into being public. bool false no
public_network_access_enabled Whether the public network access is enabled? bool true no
queue_properties_logging Logging queue properties
object({
delete = optional(bool, true)
read = optional(bool, true)
write = optional(bool, true)
version = optional(string, "1.0")
retention_policy_days = optional(number, 10)
})
{} no
queues List of objects to create some Queues in this Storage Account.
list(object({
name = string
metadata = optional(map(string))
}))
[] no
resource_group_name Resource group name string n/a yes
sftp_enabled Is SFTP enabled? bool false no
shared_access_key_enabled Indicates whether the Storage Account permits requests to be authorized with the account access key via Shared Key. If false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). bool true no
stack Project stack name string n/a yes
static_website_config Static website configuration. Can only be set when the account_kind is set to StorageV2 or BlockBlobStorage.
object({
index_document = optional(string)
error_404_document = optional(string)
})
null no
storage_account_custom_name Custom Azure Storage Account name, generated if not set string "" no
storage_blob_cors_rules Storage Account blob CORS rules. Please refer to the documentation for more information.
list(object({
allowed_headers = list(string)
allowed_methods = list(string)
allowed_origins = list(string)
exposed_headers = list(string)
max_age_in_seconds = number
}))
[] no
storage_blob_data_protection Storage account blob Data protection parameters.
object({
change_feed_enabled = optional(bool, false)
versioning_enabled = optional(bool, false)
last_access_time_enabled = optional(bool, false)
delete_retention_policy_in_days = optional(number, 0)
container_delete_retention_policy_in_days = optional(number, 0)
container_point_in_time_restore = optional(bool, false)
})
{
"change_feed_enabled": true,
"container_delete_retention_policy_in_days": 30,
"container_point_in_time_restore": true,
"delete_retention_policy_in_days": 30,
"last_access_time_enabled": true,
"versioning_enabled": true
}
no
subnet_ids Subnets to allow access to that Storage Account. list(string) [] no
tables List of objects to create some Tables in this Storage Account.
list(object({
name = string
acl = optional(list(object({
id = string
permissions = string
start = optional(string)
expiry = optional(string)
})))
}))
[] no
use_caf_naming Use the Azure CAF naming provider to generate default resource name. storage_account_custom_name override this if set. Legacy default name is used if this is set to false. bool true no
use_subdomain Should the Custom Domain Name be validated by using indirect CNAME validation? bool false no

Outputs

Name Description
storage_account_id Created Storage Account ID.
storage_account_identity Created Storage Account identity block.
storage_account_name Created Storage Account name.
storage_account_network_rules Network rules of the associated Storage Account.
storage_account_properties Created Storage Account properties.
storage_blob_containers Created blob containers in the Storage Account.
storage_file_queues Created queues in the Storage Account.
storage_file_shares Created file shares in the Storage Account.
storage_file_tables Created tables in the Storage Account.

terraform-azurerm-storage-account's People

Contributors

bzspi avatar jmapro avatar pierre-thomas-durand avatar rossifumax avatar semantic-release-bot avatar shr3ps avatar taoufik07 avatar wadhah101 avatar zfiel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

terraform-azurerm-storage-account's Issues

[FEAT] ...Add an option to disable public access

Community Note

  • Please vote on this issue by adding a ๐Ÿ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

I've noticed that in the azurerm_storage_account resource, there's an option to disable public access by setting the public_network_access_enabled parameter to false. However, I couldn't find this option in your module.

I believe it would be beneficial to include this option in your module, as it provides more control and security over storage account access.

Thank you for considering my suggestion.

New or Affected Resource(s)/Data Source(s)

azurerm_storage_account

Potential Terraform Configuration

No response

References

No response

data.azurecaf_name result is without seperator

Community Note

  • Please vote on this issue by adding a ๐Ÿ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v1.4.5

AzureRM Provider Version

3.83.0

Affected Resource(s)/Data Source(s)

azurerm 7.7.0 for storage-account

Terraform Configuration Files

module "storage-account" {
  source  = "claranet/storage-account/azurerm"
  version = "7.7.0"

  # insert the 7 required variables here
  location       = module.azure_region.location
  location_short = ""
  client_name    = var.client_name
  environment    = var.environment
  stack          = var.stack
  name_prefix = var.region_short_prefix
  use_caf_naming = true

  resource_group_name = module.rg.resource_group_name

  #allowed_cidrs = [format("%s/32", data.http.my_ip.body)]
  
  account_kind = "StorageV2"
  account_replication_type = "LRS"
  access_tier = "Hot"
  account_tier = "Standard"

  logs_destinations_ids = []

  containers = [
    {
      name = "raw"
    },
    {
      name = "curated"
      # container_access_type = "blob"
    }
  ]

  network_rules_enabled = true
  hns_enabled = true
  nfsv3_enabled = false
  min_tls_version = "TLS1_2"
  subnet_ids = [  ]

}

Debug Output/Panic Output

# module.storage-account.azurerm_storage_account.storage will be created
  + resource "azurerm_storage_account" "storage" {
      + access_tier                       = "Hot"
      + account_kind                      = "StorageV2"
      + account_replication_type          = "LRS"
      + account_tier                      = "Standard"
      + allow_nested_items_to_be_public   = false
      + cross_tenant_replication_enabled  = true
      + default_to_oauth_authentication   = false
      + enable_https_traffic_only         = true
      + id                                = (known after apply)
      + infrastructure_encryption_enabled = false
      + is_hns_enabled                    = true
      + large_file_share_enabled          = true
      + location                          = "southeastasia"
      + min_tls_version                   = "TLS1_2"
      + name                              = "cistmartechapacsandbox"
      + nfsv3_enabled                     = false
      + primary_access_key                = (sensitive value)
      + primary_blob_connection_string    = (sensitive value)
      + primary_blob_endpoint             = (known after apply)
      + primary_blob_host                 = (known after apply)
      + primary_connection_string         = (sensitive value)
      + primary_dfs_endpoint              = (known after apply)
      + primary_dfs_host                  = (known after apply)
      + primary_file_endpoint             = (known after apply)
      + primary_file_host                 = (known after apply)
      + primary_location                  = (known after apply)
      + primary_queue_endpoint            = (known after apply)
      + primary_queue_host                = (known after apply)
      + primary_table_endpoint            = (known after apply)
      + primary_table_host                = (known after apply)
      + primary_web_endpoint              = (known after apply)
      + primary_web_host                  = (known after apply)
      + public_network_access_enabled     = true
      + queue_encryption_key_type         = "Service"
      + resource_group_name               = "ci-rg-martech-apac-sandbox"
      + secondary_access_key              = (sensitive value)
      + secondary_blob_connection_string  = (sensitive value)
      + secondary_blob_endpoint           = (known after apply)
      + secondary_blob_host               = (known after apply)
      + secondary_connection_string       = (sensitive value)
      + secondary_dfs_endpoint            = (known after apply)
      + secondary_dfs_host                = (known after apply)
      + secondary_file_endpoint           = (known after apply)
      + secondary_file_host               = (known after apply)
      + secondary_location                = (known after apply)
      + secondary_queue_endpoint          = (known after apply)
      + secondary_queue_host              = (known after apply)
      + secondary_table_endpoint          = (known after apply)
      + secondary_table_host              = (known after apply)
      + secondary_web_endpoint            = (known after apply)
      + secondary_web_host                = (known after apply)
      + sftp_enabled                      = false
      + shared_access_key_enabled         = true
      + table_encryption_key_type         = "Service"
      + tags                              = {
          + "env"   = "sandbox"
          + "stack" = "martech"
        }

      + blob_properties {
          + change_feed_enabled      = true
          + default_service_version  = (known after apply)
          + last_access_time_enabled = true
          + versioning_enabled       = true

          + container_delete_retention_policy {
              + days = 30
            }

          + delete_retention_policy {
              + days = 30
            }

          + restore_policy {
              + days = 29
            }
        }

      + identity {
          + principal_id = (known after apply)
          + tenant_id    = (known after apply)
          + type         = "SystemAssigned"
        }

      + queue_properties {
          + logging {
              + delete                = true
              + read                  = true
              + retention_policy_days = 10
              + version               = "1.0"
              + write                 = true
            }
        }
    }

Expected Behaviour

module.storage-account.azurerm_storage_account.storage will be created

  • resource "azurerm_storage_account" "storage" {
    • access_tier = "Hot"

    • account_kind = "StorageV2"

    • account_replication_type = "LRS"

    • account_tier = "Standard"

    • allow_nested_items_to_be_public = false

    • cross_tenant_replication_enabled = true

    • default_to_oauth_authentication = false

    • enable_https_traffic_only = true

    • id = (known after apply)

    • infrastructure_encryption_enabled = false

    • is_hns_enabled = true

    • large_file_share_enabled = true

    • location = "southeastasia"

    • min_tls_version = "TLS1_2"

    • name = "ci-st-martech-apac-sandbox"

    • nfsv3_enabled = false

    • primary_access_key = (sensitive value)

    • primary_blob_connection_string = (sensitive value)

    • primary_blob_endpoint = (known after apply)

    • primary_blob_host = (known after apply)

    • primary_connection_string = (sensitive value)

    • primary_dfs_endpoint = (known after apply)

    • primary_dfs_host = (known after apply)

    • primary_file_endpoint = (known after apply)

    • primary_file_host = (known after apply)

    • primary_location = (known after apply)

    • primary_queue_endpoint = (known after apply)

    • primary_queue_host = (known after apply)

    • primary_table_endpoint = (known after apply)

    • primary_table_host = (known after apply)

    • primary_web_endpoint = (known after apply)

    • primary_web_host = (known after apply)

    • public_network_access_enabled = true

    • queue_encryption_key_type = "Service"

    • resource_group_name = "ci-rg-martech-apac-sandbox"

    • secondary_access_key = (sensitive value)

    • secondary_blob_connection_string = (sensitive value)

    • secondary_blob_endpoint = (known after apply)

    • secondary_blob_host = (known after apply)

    • secondary_connection_string = (sensitive value)

    • secondary_dfs_endpoint = (known after apply)

    • secondary_dfs_host = (known after apply)

    • secondary_file_endpoint = (known after apply)

    • secondary_file_host = (known after apply)

    • secondary_location = (known after apply)

    • secondary_queue_endpoint = (known after apply)

    • secondary_queue_host = (known after apply)

    • secondary_table_endpoint = (known after apply)

    • secondary_table_host = (known after apply)

    • secondary_web_endpoint = (known after apply)

    • secondary_web_host = (known after apply)

    • sftp_enabled = false

    • shared_access_key_enabled = true

    • table_encryption_key_type = "Service"

    • tags = {

      • "env" = "sandbox"
      • "stack" = "martech"
        }
    • blob_properties {

      • change_feed_enabled = true

      • default_service_version = (known after apply)

      • last_access_time_enabled = true

      • versioning_enabled = true

      • container_delete_retention_policy {

        • days = 30
          }
      • delete_retention_policy {

        • days = 30
          }
      • restore_policy {

        • days = 29
          }
          }
    • identity {

      • principal_id = (known after apply)
      • tenant_id = (known after apply)
      • type = "SystemAssigned"
        }
    • queue_properties {

      • logging {
        • delete = true
        • read = true
        • retention_policy_days = 10
        • version = "1.0"
        • write = true
          }
          }
          }

Actual Behaviour

Storage Account Name created - cistmartechapacsandbox

Steps to Reproduce

terraform init
terraform plan

Important Factoids

No response

References

No response

Classic diagnostic settings enable and disable through terraform

Description

I know there is a resource azurerm_monitor_diagnostic_setting for enabling or disabling diagnostic settings. But this is for the new Diagnostic settings. Can you please let me know how to enable/disable the Classic diagnostic logs ? Below is the image of what I am looking for?
image

CAF naming resulting in inconsistent results

Community Note

  • Please vote on this issue by adding a ๐Ÿ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v1.4.5

AzureRM Provider Version

3.83.0

Affected Resource(s)/Data Source(s)

azurerm 7.7.0 - r-storage-account.tf

Terraform Configuration Files

variables.tf - 
variable "azure_region" {
  description = "Azure region to use"
  type        = string
  default = "Southeast Asia"
}

variable "client_name" {
  description = "Client name/account used in naming"
  type        = string
  default = "apac"
}

variable "environment" {
  description = "Project environment"
  type        = string
  default = "sandbox"
}

variable "region_short_prefix" {
  description = "Resource region"
  type        = string
  default = "ci"
}

variable "stack" {
  description = "Project stack name"
  type        = string
  default = "martech"
}

main.tf -

module "rg"     {
  source  = "claranet/rg/azurerm"
  version = "6.1.0"

  client_name = "${var.client_name}-app-01"
  environment = var.environment
  location    = module.azure_region.location
  stack       = var.stack
  name_prefix = var.region_short_prefix
}

module "uc-rg" {
  source  = "claranet/rg/azurerm"
  version = "6.1.0"

  client_name = "${var.client_name}-uc-01"
  environment = var.environment
  location    = module.azure_region.location
  stack       = var.stack
  name_prefix = var.region_short_prefix
}

module "storage-account" {
  source  = "claranet/storage-account/azurerm"
  version = "7.7.0"

  # insert the 7 required variables here
  location       = module.azure_region.location
  location_short = ""
  client_name    = "${var.client_name}-app-01"
  environment    = var.environment
  stack          = var.stack
  name_prefix = var.region_short_prefix
  use_caf_naming = true

  resource_group_name = module.rg.resource_group_name

  #allowed_cidrs = [format("%s/32", data.http.my_ip.body)]
  
  account_kind = "StorageV2"
  account_replication_type = "LRS"
  access_tier = "Hot"
  account_tier = "Standard"

  custom_diagnostic_settings_name = ""
  logs_destinations_ids = []

  containers = [
    {
      name = "raw"
    },
    {
      name = "curated"
      # container_access_type = "blob"
    }
  ]
  storage_blob_data_protection = {}

  network_rules_enabled = false
  hns_enabled = true
  nfsv3_enabled = false
  min_tls_version = "TLS1_2"
  subnet_ids = [  ]

}

module "uc-storage-account" {
  source  = "claranet/storage-account/azurerm"
  version = "7.7.0"

  # insert the 7 required variables here
  location       = module.azure_region.location
  location_short = ""
  client_name    = "${var.client_name}-uc-01"
  environment    = var.environment
  stack          = var.stack
  name_prefix = var.region_short_prefix
  use_caf_naming = true

  resource_group_name = module.uc-rg.resource_group_name

  #allowed_cidrs = [format("%s/32", data.http.my_ip.body)]
  
  account_kind = "StorageV2"
  account_replication_type = "LRS"
  access_tier = "Hot"
  account_tier = "Standard"

  custom_diagnostic_settings_name = ""
  logs_destinations_ids = []

  containers = [
    {
      name = "unity-catalog-container"
    }
  ]
  storage_blob_data_protection = {}

  network_rules_enabled = false
  hns_enabled = true
  nfsv3_enabled = false
  min_tls_version = "TLS1_2"
  subnet_ids = [  ]

}

Debug Output/Panic Output

NA

Expected Behaviour

Two storage accounts should have been created with the following names -

cistmartechapacuc01sandbox
cistmartechapacapp01sandbox

Actual Behaviour

Two storage accounts were created with the following names -

cistmartechapacapp01
stmartechapacuc01sandbox

Steps to Reproduce

terraform plan
terraform apply

Important Factoids

No response

References

No response

[BUG] Example is not working

Community Note

  • Please vote on this issue by adding a ๐Ÿ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

1.3.3

AzureRM Provider Version

3.55.0

Affected Resource(s)/Data Source(s)

module.storage_account.azurerm_storage_account.storage

Terraform Configuration Files

If I try to deploy the example at `examples/main`, using the latest versions for all the Claranet modules, I get this error:


module.storage_account.azurerm_storage_account.storage: Creating...
โ•ท
โ”‚ Error: creating Azure Storage Account "stmanolomanoloeuwdev": storage.AccountsClient#Create: Failure sending request: StatusCode=404 -- Original Error: Code="NotFound" Message="The resource 'xxx-xxx-xxx-xxx' does not exist."
โ”‚
โ”‚   with module.storage_account.azurerm_storage_account.storage,
โ”‚   on .terraform/modules/storage_account/r-storage-account.tf line 1, in resource "azurerm_storage_account" "storage":
โ”‚    1: resource "azurerm_storage_account" "storage" {

Where "xxx-xxx-xxx-xxx" is the ID of the tenant.



### Debug Output/Panic Output

```shell
https://gist.github.com/juan-acevedo-ntt/61a139c0b169f27592f8b9b321b4141f

Expected Behaviour

Working example

Actual Behaviour

Only the resource group is created

Steps to Reproduce

  • Change "x.x.x" in the example with current latest versions for each module
  • make init
  • make apply

Important Factoids

No response

References

No response

Multiple cors_rule [FEAT] ...

Community Note

  • Please vote on this issue by adding a ๐Ÿ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Create mutiple cors rules inside blob_properties

New or Affected Resource(s)/Data Source(s)

azurerm_storage_account

Potential Terraform Configuration

variable "storage_blob_cors_rule" {
  description = "A map of storage account settings including CORS rules."
  type        = map(object({
    cors_rules = list(object({
      allowed_origins     = list(string)
      allowed_methods     = list(string)
      allowed_headers     = list(string)
      exposed_headers     = list(string)
      max_age_in_seconds  = number
    }))
  }))
  default = {
    default = {
      cors_rules = [
        {
          allowed_origins     = ["*"]
          allowed_methods     = ["GET"]
          allowed_headers     = ["*"]
          exposed_headers     = ["*"]
          max_age_in_seconds  = 3600
        },
      ]
    }
  }
}

References

No response

[BUG] Creating storage account Premium

Community Note

  • Please vote on this issue by adding a ๐Ÿ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

1.5.7

AzureRM Provider Version

3.85.0

Affected Resource(s)/Data Source(s)

azurerm_storage_account

Terraform Configuration Files

module "app_static_web_auth_test" {
  source  = "claranet/storage-account/azurerm"
  version = "7.8.0"

  storage_account_custom_name = "test${terraform.workspace}staticweb"
  client_name                 = "static-web-test"
  environment                 = local.environment
  location                    = data.terraform_remote_state.core-infra.outputs.azure_location
  location_short              = data.terraform_remote_state.core-infra.outputs.azure_short_location
  resource_group_name         = data.terraform_remote_state.core-infra.outputs.azure_resource_group_name
  stack                       = "auth-test"
  default_tags_enabled        = false
  extra_tags                  = local.tags
  https_traffic_only_enabled  = true
  account_tier                = "Premium"
  account_kind                = "BlockBlobStorage"
  access_tier                 = "Hot"
  account_replication_type    = "ZRS"

  logs_destinations_ids = []

  storage_blob_cors_rule = {
    allowed_headers    = ["*"]
    allowed_methods    = ["GET", "HEAD"]
    allowed_origins    = ["*"]
    exposed_headers    = ["*"]
    max_age_in_seconds = 3600
  }

  storage_blob_data_protection = {
    change_feed_enabled                       = true
    versioning_enabled                        = true
    delete_retention_policy_in_days           = 30
    container_delete_retention_policy_in_days = 30
    container_point_in_time_restore           = true
  }

  default_firewall_action = "Allow"
  network_rules_enabled   = true
  allowed_cidrs           = ["147.243.0.0/16"]
  network_bypass          = ["AzureServices"]

  static_website_config = {
    index_document     = "benefits.html"
    error_404_document = "error.html"
  }
}

Debug Output/Panic Output

module.app_static_web_auth_test.azurerm_storage_account.storage: Still creating... [8m20s elapsed]
โ•ท
โ”‚ Error: updating `blob_properties`: storage.BlobServicesClient#SetServiceProperties: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="OperationNotAllowedOnKind" Message="The operation is not allowed on account kind BlockBlobStorage"
โ”‚
โ”‚   with module.app_static_web_auth_test.azurerm_storage_account.storage,
โ”‚   on .terraform/modules/app_static_web_auth_test/r-storage-account.tf line 1, in resource "azurerm_storage_account" "storage":
โ”‚    1: resource "azurerm_storage_account" "storage" {
โ”‚

Expected Behaviour

Hi, I'm trying to create a storage account as Premium with kind of BlockBlobStorage for a static website and I'm getting the error provided in the output. I'm missing something, could somebody help me ?

Thank you

Actual Behaviour

No response

Steps to Reproduce

No response

Important Factoids

No response

References

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.