Separated variables from the resources.
This commit is contained in:
38
main.tf
38
main.tf
@@ -17,34 +17,6 @@ provider "azurerm" {
|
|||||||
subscription_id = var.subscription_id
|
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" {
|
resource "azurerm_resource_group" "rg" {
|
||||||
name = "rg-${var.project_name}"
|
name = "rg-${var.project_name}"
|
||||||
location = "Poland Central"
|
location = "Poland Central"
|
||||||
@@ -64,11 +36,6 @@ resource "azurerm_container_app_environment" "env" {
|
|||||||
location = azurerm_resource_group.rg.location
|
location = azurerm_resource_group.rg.location
|
||||||
log_analytics_workspace_id = azurerm_log_analytics_workspace.logaws.id
|
log_analytics_workspace_id = azurerm_log_analytics_workspace.logaws.id
|
||||||
|
|
||||||
identity {
|
|
||||||
type = "UserAssigned"
|
|
||||||
identity_ids = [azurerm_user_assigned_identity.uai.id]
|
|
||||||
}
|
|
||||||
|
|
||||||
workload_profile {
|
workload_profile {
|
||||||
maximum_count = 1
|
maximum_count = 1
|
||||||
minimum_count = 1
|
minimum_count = 1
|
||||||
@@ -131,11 +98,6 @@ resource "azurerm_container_app" "app" {
|
|||||||
server = "skdomlab.azurecr.io"
|
server = "skdomlab.azurecr.io"
|
||||||
identity = azurerm_user_assigned_identity.uai.id
|
identity = azurerm_user_assigned_identity.uai.id
|
||||||
}
|
}
|
||||||
|
|
||||||
identity {
|
|
||||||
type = "UserAssigned"
|
|
||||||
identity_ids = [azurerm_user_assigned_identity.uai.id]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "azurerm_user_assigned_identity" "uai" {
|
resource "azurerm_user_assigned_identity" "uai" {
|
||||||
|
|||||||
27
variables.tf
Normal file
27
variables.tf
Normal file
@@ -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
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user