creating storage module
This commit is contained in:
@@ -1,13 +0,0 @@
|
|||||||
resource "azurerm_storage_account" "storage_account" {
|
|
||||||
name = var.storage_account_name
|
|
||||||
resource_group_name = data.azurerm_resource_group.resource_group.name
|
|
||||||
location = data.azurerm_resource_group.resource_group.location
|
|
||||||
account_tier = "Standard"
|
|
||||||
account_replication_type = "LRS"
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "azurerm_storage_table" "storage_table" {
|
|
||||||
count = length(var.storage_tables)
|
|
||||||
name = var.storage_tables[count.index]
|
|
||||||
storage_account_name = azurerm_storage_account.storage_account.name
|
|
||||||
}
|
|
||||||
@@ -68,14 +68,10 @@ variable "resource_group_name" {
|
|||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "storage_account_name" {
|
variable "storage_account_primary_connection_string" {
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "storage_tables" {
|
|
||||||
type = list(string)
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "tenant_id" {
|
variable "tenant_id" {
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
3
modules/storage/resource_group.tf
Normal file
3
modules/storage/resource_group.tf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
data "azurerm_resource_group" "resource_group" {
|
||||||
|
name = var.resource_group_name
|
||||||
|
}
|
||||||
7
modules/storage/storage_account.tf
Normal file
7
modules/storage/storage_account.tf
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
resource "azurerm_storage_account" "storage_account" {
|
||||||
|
name = var.storage_account_name
|
||||||
|
resource_group_name = data.azurerm_resource_group.resource_group.name
|
||||||
|
location = data.azurerm_resource_group.resource_group.location
|
||||||
|
account_tier = var.account_tier
|
||||||
|
account_replication_type = var.account_replication_type
|
||||||
|
}
|
||||||
0
modules/storage/storage_queue.tf
Normal file
0
modules/storage/storage_queue.tf
Normal file
5
modules/storage/storage_table.tf
Normal file
5
modules/storage/storage_table.tf
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
resource "azurerm_storage_table" "storage_table" {
|
||||||
|
count = length(var.storage_tables)
|
||||||
|
name = var.storage_tables[count.index]
|
||||||
|
storage_account_name = azurerm_storage_account.storage_account.name
|
||||||
|
}
|
||||||
27
modules/storage/variables.tf
Normal file
27
modules/storage/variables.tf
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
variable "account_replication_type" {
|
||||||
|
default = "LRS"
|
||||||
|
type = string
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "account_tier" {
|
||||||
|
default = "Standard"
|
||||||
|
type = string
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "resource_group_name" {
|
||||||
|
type = string
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "storage_account_name" {
|
||||||
|
type = string
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "storage_queues" {
|
||||||
|
default = []
|
||||||
|
type = list(string)
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "storage_tables" {
|
||||||
|
default = []
|
||||||
|
type = list(string)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user