creating storage module

This commit is contained in:
2025-02-24 08:11:09 -06:00
parent 01b3303a38
commit 8217cfb99b
7 changed files with 43 additions and 18 deletions

View File

@@ -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
}

View File

@@ -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
} }

View File

@@ -0,0 +1,3 @@
data "azurerm_resource_group" "resource_group" {
name = var.resource_group_name
}

View 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
}

View File

View 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
}

View 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)
}