From ce14fafbf381f65d785eb20183014d3a36da9a2d Mon Sep 17 00:00:00 2001 From: Slawek Koszewski Date: Fri, 15 Aug 2025 13:43:48 +0200 Subject: [PATCH] Separated variables from the resources. --- main.tf | 38 -------------------------------------- variables.tf | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 38 deletions(-) create mode 100644 variables.tf diff --git a/main.tf b/main.tf index 7021506..e66b45a 100644 --- a/main.tf +++ b/main.tf @@ -17,34 +17,6 @@ provider "azurerm" { subscription_id = var.subscription_id } -variable "subscription_id" { - description = "The Azure Subscription ID to use for the resources." - type = string -} - -variable "azure_client_id" { - description = "The Azure Client ID for authentication." - type = string - -} - -variable "azure_tenant_id" { - description = "The Azure Tenant ID for authentication." - type = string - -} - -variable "azure_client_secret" { - description = "The Azure Client Secret for authentication." - type = string - sensitive = true -} - -variable "project_name" { - description = "The name used to construct Azure resource names." - type = string -} - resource "azurerm_resource_group" "rg" { name = "rg-${var.project_name}" location = "Poland Central" @@ -64,11 +36,6 @@ resource "azurerm_container_app_environment" "env" { location = azurerm_resource_group.rg.location log_analytics_workspace_id = azurerm_log_analytics_workspace.logaws.id - identity { - type = "UserAssigned" - identity_ids = [azurerm_user_assigned_identity.uai.id] - } - workload_profile { maximum_count = 1 minimum_count = 1 @@ -131,11 +98,6 @@ resource "azurerm_container_app" "app" { server = "skdomlab.azurecr.io" identity = azurerm_user_assigned_identity.uai.id } - - identity { - type = "UserAssigned" - identity_ids = [azurerm_user_assigned_identity.uai.id] - } } resource "azurerm_user_assigned_identity" "uai" { diff --git a/variables.tf b/variables.tf new file mode 100644 index 0000000..71dd98f --- /dev/null +++ b/variables.tf @@ -0,0 +1,27 @@ +variable "subscription_id" { + description = "The Azure Subscription ID to use for the resources." + type = string +} + +variable "azure_client_id" { + description = "The Azure Client ID for authentication." + type = string + +} + +variable "azure_tenant_id" { + description = "The Azure Tenant ID for authentication." + type = string + +} + +variable "azure_client_secret" { + description = "The Azure Client Secret for authentication." + type = string + sensitive = true +} + +variable "project_name" { + description = "The name used to construct Azure resource names." + type = string +}