From 2837a8fe2e10cb1117d8c42c52104c8924b09b7a Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Tue, 18 Feb 2025 07:27:25 +0300 Subject: [PATCH] Add dynamic name for Gallery in Azure --- terraform/azure/main.tf | 4 ++-- terraform/azure/variables.tf | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/terraform/azure/main.tf b/terraform/azure/main.tf index ee9b01d4..af193f70 100644 --- a/terraform/azure/main.tf +++ b/terraform/azure/main.tf @@ -1,6 +1,6 @@ resource "azurerm_resource_group" "rg" { location = var.resource_group_location - name = "community" + name = var.rg_name } resource "azurerm_virtual_network" "antmedia-marketplace" { @@ -229,7 +229,7 @@ resource "null_resource" "generalize_vm" { resource "azurerm_shared_image_gallery" "antmedia-marketplace" { - name = "antmedia_image_gallery_${var.ams_version}" + name = "antmedia_image_gallery_${azurerm_resource_group.rg.name}_${var.ams_version}" location = azurerm_resource_group.rg.location resource_group_name = azurerm_resource_group.rg.name description = "Shared images and things." diff --git a/terraform/azure/variables.tf b/terraform/azure/variables.tf index b621db5f..2d64af27 100644 --- a/terraform/azure/variables.tf +++ b/terraform/azure/variables.tf @@ -6,8 +6,13 @@ variable "resource_group_location" { variable "resource_group_name_enterprise" { default = "enterprise" description = "Name" + type = string } +variable "rg_name" { + description = "Enter the Azure Resource Group Name" + type = string +} variable "resource_group_name_community" { default = "community"