From 8217cfb99b9a8ec4c75b037f630a9001422903e8 Mon Sep 17 00:00:00 2001 From: Noah Spannbauer Date: Mon, 24 Feb 2025 08:11:09 -0600 Subject: [PATCH] creating storage module --- modules/container_app/storage_account.tf | 13 ------------ modules/container_app/variables.tf | 6 +----- modules/storage/resource_group.tf | 3 +++ modules/storage/storage_account.tf | 7 ++++++ modules/storage/storage_queue.tf | 0 modules/storage/storage_table.tf | 5 +++++ modules/storage/variables.tf | 27 ++++++++++++++++++++++++ 7 files changed, 43 insertions(+), 18 deletions(-) delete mode 100644 modules/container_app/storage_account.tf create mode 100644 modules/storage/resource_group.tf create mode 100644 modules/storage/storage_account.tf create mode 100644 modules/storage/storage_queue.tf create mode 100644 modules/storage/storage_table.tf create mode 100644 modules/storage/variables.tf diff --git a/modules/container_app/storage_account.tf b/modules/container_app/storage_account.tf deleted file mode 100644 index a6fa042..0000000 --- a/modules/container_app/storage_account.tf +++ /dev/null @@ -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 -} \ No newline at end of file diff --git a/modules/container_app/variables.tf b/modules/container_app/variables.tf index 3594105..78e8740 100644 --- a/modules/container_app/variables.tf +++ b/modules/container_app/variables.tf @@ -68,14 +68,10 @@ variable "resource_group_name" { type = string } -variable "storage_account_name" { +variable "storage_account_primary_connection_string" { type = string } -variable "storage_tables" { - type = list(string) -} - variable "tenant_id" { type = string } \ No newline at end of file diff --git a/modules/storage/resource_group.tf b/modules/storage/resource_group.tf new file mode 100644 index 0000000..f68b1dd --- /dev/null +++ b/modules/storage/resource_group.tf @@ -0,0 +1,3 @@ +data "azurerm_resource_group" "resource_group" { + name = var.resource_group_name +} \ No newline at end of file diff --git a/modules/storage/storage_account.tf b/modules/storage/storage_account.tf new file mode 100644 index 0000000..ee5ac04 --- /dev/null +++ b/modules/storage/storage_account.tf @@ -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 +} \ No newline at end of file diff --git a/modules/storage/storage_queue.tf b/modules/storage/storage_queue.tf new file mode 100644 index 0000000..e69de29 diff --git a/modules/storage/storage_table.tf b/modules/storage/storage_table.tf new file mode 100644 index 0000000..3463097 --- /dev/null +++ b/modules/storage/storage_table.tf @@ -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 +} \ No newline at end of file diff --git a/modules/storage/variables.tf b/modules/storage/variables.tf new file mode 100644 index 0000000..9d59aa1 --- /dev/null +++ b/modules/storage/variables.tf @@ -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) +} \ No newline at end of file