Skip to content

Commit 5f3a204

Browse files
committed
* 'master' of https://github.com/kumarvna/terraform-azurerm-storage: fix: support for allow_blob_public_access attribute has been removed in azurem 3.1.0 feat: add storage_account_primary_blob_endpoint output Add proper variable types
2 parents 02682e8 + 7e9bed0 commit 5f3a204

File tree

5 files changed

+28
-3
lines changed

5 files changed

+28
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ Name | Description
277277
`storage_account_id`|The ID of the storage account
278278
`sorage_account_name`|The name of the storage account
279279
`storage_account_primary_location`|The primary location of the storage account
280+
`storage_account_primary_blob_endpoint`|The endpoint URL for blob storage in the primary location
280281
`storage_account_primary_web_endpoint`|The endpoint URL for web storage in the primary location
281282
`storage_account_primary_web_host`|The hostname with port if applicable for web storage in the primary location
282283
`storage_primary_connection_string`|The primary connection string for the storage account

examples/complete/output.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ output "storage_account_primary_location" {
2828
value = module.storage.storage_account_primary_location
2929
}
3030

31+
output "storage_account_primary_blob_endpoint" {
32+
description = "The endpoint URL for blob storage in the primary location."
33+
value = module.storage.storage_account_primary_blob_endpoint
34+
}
35+
3136
output "storage_account_primary_web_endpoint" {
3237
description = "The endpoint URL for web storage in the primary location."
3338
value = module.storage.storage_account_primary_web_endpoint

main.tf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ resource "azurerm_storage_account" "storeacc" {
4141
account_replication_type = local.account_replication_type
4242
enable_https_traffic_only = true
4343
min_tls_version = var.min_tls_version
44-
allow_blob_public_access = var.enable_advanced_threat_protection == true ? true : false
4544
tags = merge({ "ResourceName" = substr(format("sta%s%s", lower(replace(var.storage_account_name, "/[[:^alnum:]]/", "")), random_string.unique.result), 0, 24) }, var.tags, )
4645

4746
identity {
@@ -56,9 +55,9 @@ resource "azurerm_storage_account" "storeacc" {
5655
container_delete_retention_policy {
5756
days = var.container_soft_delete_retention_days
5857
}
59-
versioning_enabled = var.enable_versioning
58+
versioning_enabled = var.enable_versioning
6059
last_access_time_enabled = var.last_access_time_enabled
61-
change_feed_enabled = var.change_feed_enabled
60+
change_feed_enabled = var.change_feed_enabled
6261
}
6362

6463
dynamic "network_rules" {

output.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ output "storage_account_primary_location" {
2828
value = azurerm_storage_account.storeacc.primary_location
2929
}
3030

31+
output "storage_account_primary_blob_endpoint" {
32+
description = "The endpoint URL for blob storage in the primary location."
33+
value = azurerm_storage_account.storeacc.primary_blob_endpoint
34+
}
35+
3136
output "storage_account_primary_web_endpoint" {
3237
description = "The endpoint URL for web storage in the primary location."
3338
value = azurerm_storage_account.storeacc.primary_web_endpoint

variables.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,85 @@
11
variable "create_resource_group" {
22
description = "Whether to create resource group and use it for all networking resources"
33
default = false
4+
type = bool
45
}
56

67
variable "resource_group_name" {
78
description = "A container that holds related resources for an Azure solution"
89
default = "rg-demo-westeurope-01"
10+
type = string
911
}
1012

1113
variable "location" {
1214
description = "The location/region to keep all your network resources. To get the list of all locations with table format from azure cli, run 'az account list-locations -o table'"
1315
default = "westeurope"
16+
type = string
1417
}
1518

1619
variable "storage_account_name" {
1720
description = "The name of the azure storage account"
1821
default = ""
22+
type = string
1923
}
2024

2125
variable "account_kind" {
2226
description = "The type of storage account. Valid options are BlobStorage, BlockBlobStorage, FileStorage, Storage and StorageV2."
2327
default = "StorageV2"
28+
type = string
2429
}
2530

2631
variable "skuname" {
2732
description = "The SKUs supported by Microsoft Azure Storage. Valid options are Premium_LRS, Premium_ZRS, Standard_GRS, Standard_GZRS, Standard_LRS, Standard_RAGRS, Standard_RAGZRS, Standard_ZRS"
2833
default = "Standard_RAGRS"
34+
type = string
2935
}
3036

3137
variable "access_tier" {
3238
description = "Defines the access tier for BlobStorage and StorageV2 accounts. Valid options are Hot and Cool."
3339
default = "Hot"
40+
type = string
3441
}
3542

3643
variable "min_tls_version" {
3744
description = "The minimum supported TLS version for the storage account"
3845
default = "TLS1_2"
46+
type = string
3947
}
4048

4149
variable "blob_soft_delete_retention_days" {
4250
description = "Specifies the number of days that the blob should be retained, between `1` and `365` days. Defaults to `7`"
4351
default = 7
52+
type = number
4453
}
4554

4655
variable "container_soft_delete_retention_days" {
4756
description = "Specifies the number of days that the blob should be retained, between `1` and `365` days. Defaults to `7`"
4857
default = 7
58+
type = number
4959
}
5060

5161
variable "enable_versioning" {
5262
description = "Is versioning enabled? Default to `false`"
5363
default = false
64+
type = bool
5465
}
5566

5667
variable "last_access_time_enabled" {
5768
description = "Is the last access time based tracking enabled? Default to `false`"
5869
default = false
70+
type = bool
5971
}
6072

6173
variable "change_feed_enabled" {
6274
description = "Is the blob service properties for change feed events enabled?"
6375
default = false
76+
type = bool
6477
}
6578

6679
variable "enable_advanced_threat_protection" {
6780
description = "Boolean flag which controls if advanced threat protection is enabled."
6881
default = false
82+
type = bool
6983
}
7084

7185
variable "network_rules" {
@@ -106,6 +120,7 @@ variable "lifecycles" {
106120
variable "identity_ids" {
107121
description = "Specifies a list of user managed identity ids to be assigned. This is required when `type` is set to `UserAssigned` or `SystemAssigned, UserAssigned`"
108122
default = null
123+
type = list(string)
109124
}
110125

111126
variable "tags" {

0 commit comments

Comments
 (0)