Skip to content

Commit b0313af

Browse files
authored
Merge pull request #18 from kumarvna/develop
update to version 2.5.0
2 parents 1931a22 + d129ff0 commit b0313af

File tree

9 files changed

+102
-32
lines changed

9 files changed

+102
-32
lines changed

README.md

+45-12
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,34 @@ To defines the kind of account, set the argument to `account_kind = "StorageV2"`
1717
* [Storage Queue](https://www.terraform.io/docs/providers/azurerm/r/storage_queue.html)
1818
* [Network Policies](https://www.terraform.io/docs/providers/azurerm/r/storage_account.html#network_rules)
1919
* [Azure Blob storage lifecycle](https://www.terraform.io/docs/providers/azurerm/r/storage_management_policy.html)
20+
* [Managed Service Identity](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_account#identity)
2021

2122
## Module Usage
2223

23-
```hcl
24+
```terraform
2425
# Azure Provider configuration
2526
provider "azurerm" {
2627
features {}
2728
}
2829
30+
resource "azurerm_user_assigned_identity" "example" {
31+
for_each = toset(["user-identity1", "user-identity2"])
32+
resource_group_name = "rg-shared-westeurope-01"
33+
location = "westeurope"
34+
name = each.key
35+
}
36+
2937
module "storage" {
3038
source = "kumarvna/storage/azurerm"
3139
version = "2.5.0"
3240
3341
# By default, this module will not create a resource group
34-
# proivde a name to use an existing resource group, specify the existing resource group name,
35-
# and set the argument to `create_resource_group = false`. Location will be same as existing RG.
36-
resource_group_name = "rg-demo-internal-shared-westeurope-002"
37-
location = "westeurope"
38-
storage_account_name = "mydefaultstorage"
42+
# proivde a name to use an existing resource group, specify the existing resource group name,
43+
# and set the argument to `create_resource_group = false`. Location will be same as existing RG.
44+
create_resource_group = true
45+
resource_group_name = "rg-demo-internal-shared-westeurope-002"
46+
location = "westeurope"
47+
storage_account_name = "mystorage"
3948
4049
# To enable advanced threat protection set argument to `true`
4150
enable_advanced_threat_protection = true
@@ -59,8 +68,32 @@ module "storage" {
5968
# Storage queues
6069
queues = ["queue1", "queue2"]
6170
71+
# Configure managed identities to access Azure Storage (Optional)
72+
# Possible types are `SystemAssigned`, `UserAssigned` and `SystemAssigned, UserAssigned`.
73+
managed_identity_type = "UserAssigned"
74+
managed_identity_ids = [for k in azurerm_user_assigned_identity.example : k.id]
75+
76+
# Lifecycle management for storage account.
77+
# Must specify the value to each argument and default is `0`
78+
lifecycles = [
79+
{
80+
prefix_match = ["mystore250/folder_path"]
81+
tier_to_cool_after_days = 0
82+
tier_to_archive_after_days = 50
83+
delete_after_days = 100
84+
snapshot_delete_after_days = 30
85+
},
86+
{
87+
prefix_match = ["blobstore251/another_path"]
88+
tier_to_cool_after_days = 0
89+
tier_to_archive_after_days = 30
90+
delete_after_days = 75
91+
snapshot_delete_after_days = 30
92+
}
93+
]
94+
6295
# Adding TAG's to your Azure resources (Required)
63-
# ProjectName and Env are already declared above, to use them here, create a varible.
96+
# ProjectName and Env are already declared above, to use them here, create a varible.
6497
tags = {
6598
ProjectName = "demo-internal"
6699
Env = "dev"
@@ -200,7 +233,7 @@ Regardless of the type of identity chosen a managed identity is a service princi
200233
```terraform
201234
resource "azurerm_user_assigned_identity" "example" {
202235
for_each = toset(["user-identity1", "user-identity2"])
203-
resource_group_name = "rg-demo-internal-shared-westeurope-002"
236+
resource_group_name = "rg-shared-westeurope-01"
204237
location = "westeurope"
205238
name = each.key
206239
}
@@ -235,15 +268,15 @@ An effective naming convention assembles resource names by using important resou
235268

236269
| Name | Version |
237270
|------|---------|
238-
| terraform | >= 0.13 |
239-
| azurerm | >= 2.59.0 |
271+
| terraform | >= 1.1.0 |
272+
| azurerm | >= 3.1.0 |
240273

241274
## Providers
242275

243276
| Name | Version |
244277
|------|---------|
245-
| azurerm | >= 2.59 |
246-
| random | n/a |
278+
| azurerm | >= 3.1.0 |
279+
| random | >= 3.1.0 |
247280

248281
## Inputs
249282

examples/README.md

+20-7
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,24 @@ provider "azurerm" {
9292
features {}
9393
}
9494
95+
resource "azurerm_user_assigned_identity" "example" {
96+
for_each = toset(["user-identity1", "user-identity2"])
97+
resource_group_name = "rg-shared-westeurope-01"
98+
location = "westeurope"
99+
name = each.key
100+
}
101+
95102
module "storage" {
96103
source = "kumarvna/storage/azurerm"
97104
version = "2.5.0"
98105
99106
# By default, this module will not create a resource group
100-
# proivde a name to use an existing resource group, specify the existing resource group name,
101-
# and set the argument to `create_resource_group = false`. Location will be same as existing RG.
102-
resource_group_name = "rg-demo-internal-shared-westeurope-002"
103-
location = "westeurope"
104-
storage_account_name = "mydefaultstorage"
107+
# proivde a name to use an existing resource group, specify the existing resource group name,
108+
# and set the argument to `create_resource_group = false`. Location will be same as existing RG.
109+
create_resource_group = true
110+
resource_group_name = "rg-demo-internal-shared-westeurope-002"
111+
location = "westeurope"
112+
storage_account_name = "mystorage"
105113
106114
# To enable advanced threat protection set argument to `true`
107115
enable_advanced_threat_protection = true
@@ -125,8 +133,13 @@ module "storage" {
125133
# Storage queues
126134
queues = ["queue1", "queue2"]
127135
136+
# Configure managed identities to access Azure Storage (Optional)
137+
# Possible types are `SystemAssigned`, `UserAssigned` and `SystemAssigned, UserAssigned`.
138+
managed_identity_type = "UserAssigned"
139+
managed_identity_ids = [for k in azurerm_user_assigned_identity.example : k.id]
140+
128141
# Lifecycle management for storage account.
129-
# Must specify the value to each argument and default is `0`
142+
# Must specify the value to each argument and default is `0`
130143
lifecycles = [
131144
{
132145
prefix_match = ["mystore250/folder_path"]
@@ -145,7 +158,7 @@ module "storage" {
145158
]
146159
147160
# Adding TAG's to your Azure resources (Required)
148-
# ProjectName and Env are already declared above, to use them here, create a varible.
161+
# ProjectName and Env are already declared above, to use them here, create a varible.
149162
tags = {
150163
ProjectName = "demo-internal"
151164
Env = "dev"

examples/complete/README.md

+21-8
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,24 @@ provider "azurerm" {
88
features {}
99
}
1010
11+
resource "azurerm_user_assigned_identity" "example" {
12+
for_each = toset(["user-identity1", "user-identity2"])
13+
resource_group_name = "rg-shared-westeurope-01"
14+
location = "westeurope"
15+
name = each.key
16+
}
17+
1118
module "storage" {
1219
source = "kumarvna/storage/azurerm"
13-
version = "2.4.0"
20+
version = "2.5.0"
1421
1522
# By default, this module will not create a resource group
16-
# proivde a name to use an existing resource group, specify the existing resource group name,
17-
# and set the argument to `create_resource_group = false`. Location will be same as existing RG.
18-
resource_group_name = "rg-demo-internal-shared-westeurope-002"
19-
location = "westeurope"
20-
storage_account_name = "mydefaultstorage"
23+
# proivde a name to use an existing resource group, specify the existing resource group name,
24+
# and set the argument to `create_resource_group = false`. Location will be same as existing RG.
25+
create_resource_group = true
26+
resource_group_name = "rg-demo-internal-shared-westeurope-002"
27+
location = "westeurope"
28+
storage_account_name = "mystorage"
2129
2230
# To enable advanced threat protection set argument to `true`
2331
enable_advanced_threat_protection = true
@@ -41,8 +49,13 @@ module "storage" {
4149
# Storage queues
4250
queues = ["queue1", "queue2"]
4351
52+
# Configure managed identities to access Azure Storage (Optional)
53+
# Possible types are `SystemAssigned`, `UserAssigned` and `SystemAssigned, UserAssigned`.
54+
managed_identity_type = "UserAssigned"
55+
managed_identity_ids = [for k in azurerm_user_assigned_identity.example : k.id]
56+
4457
# Lifecycle management for storage account.
45-
# Must specify the value to each argument and default is `0`
58+
# Must specify the value to each argument and default is `0`
4659
lifecycles = [
4760
{
4861
prefix_match = ["mystore250/folder_path"]
@@ -61,7 +74,7 @@ module "storage" {
6174
]
6275
6376
# Adding TAG's to your Azure resources (Required)
64-
# ProjectName and Env are already declared above, to use them here, create a varible.
77+
# ProjectName and Env are already declared above, to use them here, create a varible.
6578
tags = {
6679
ProjectName = "demo-internal"
6780
Env = "dev"

examples/complete/main.tf

+12
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ provider "azurerm" {
33
features {}
44
}
55

6+
resource "azurerm_user_assigned_identity" "example" {
7+
for_each = toset(["user-identity1", "user-identity2"])
8+
resource_group_name = "rg-shared-westeurope-01"
9+
location = "westeurope"
10+
name = each.key
11+
}
12+
613
module "storage" {
714
source = "kumarvna/storage/azurerm"
815
version = "2.5.0"
@@ -37,6 +44,11 @@ module "storage" {
3744
# Storage queues
3845
queues = ["queue1", "queue2"]
3946

47+
# Configure managed identities to access Azure Storage (Optional)
48+
# Possible types are `SystemAssigned`, `UserAssigned` and `SystemAssigned, UserAssigned`.
49+
managed_identity_type = "UserAssigned"
50+
managed_identity_ids = [for k in azurerm_user_assigned_identity.example : k.id]
51+
4052
# Lifecycle management for storage account.
4153
# Must specify the value to each argument and default is `0`
4254
lifecycles = [

examples/storage_account_with_containers/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ provider "azurerm" {
1212
1313
module "storage" {
1414
source = "kumarvna/storage/azurerm"
15-
version = "2.4.0"
15+
version = "2.5.0"
1616
1717
# By default, this module will not create a resource group
1818
# proivde a name to use an existing resource group, specify the existing resource group name,

examples/storage_account_with_fileshares/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ provider "azurerm" {
1212
1313
module "storage" {
1414
source = "kumarvna/storage/azurerm"
15-
version = "2.4.0"
15+
version = "2.5.0"
1616
1717
# By default, this module will not create a resource group
1818
# proivde a name to use an existing resource group, specify the existing resource group name,

graph.png

-2.8 KB
Loading

variables.tf

-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ variable "managed_identity_ids" {
129129
type = list(string)
130130
}
131131

132-
133132
variable "tags" {
134133
description = "A map of tags to add to all resources"
135134
type = map(string)

versions.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ terraform {
22
required_providers {
33
azurerm = {
44
source = "hashicorp/azurerm"
5-
version = ">= 2.59.0"
5+
version = ">= 3.1.0"
66
}
77
random = {
88
source = "hashicorp/random"
99
version = ">= 3.1.0"
1010
}
1111
}
12-
required_version = ">= 0.13"
12+
required_version = ">= 1.1.0"
1313
}

0 commit comments

Comments
 (0)