From 2724fc1698470cf6ecc15c0ac3b0f930a6a72989 Mon Sep 17 00:00:00 2001 From: Marvin Gajek Date: Sun, 28 Apr 2024 12:08:10 +0200 Subject: [PATCH] move modules --- devops/terraform/main.tf | 14 ++++++++- devops/terraform/output.tf | 13 +++++++++ devops/terraform/variables.tf | 29 +++++++++++++++++-- terraform/envs/sbx-k8s-deployment/main.tf | 14 +-------- terraform/envs/sbx-k8s-deployment/output.tf | 14 --------- .../envs/sbx-k8s-deployment/variables.tf | 27 +---------------- 6 files changed, 55 insertions(+), 56 deletions(-) create mode 100644 devops/terraform/output.tf diff --git a/devops/terraform/main.tf b/devops/terraform/main.tf index ce0b75e..41d5fe1 100644 --- a/devops/terraform/main.tf +++ b/devops/terraform/main.tf @@ -1,6 +1,6 @@ module "main" { source = "git::https://github.com/MGTheTrain/gitops-ftw.git//devops/terraform?ref=main" - digital_product_affix = var.digital_product_affix + digital_product_affix = var.digital_product_affix_sa environment = var.environment resource_instance_number = var.resource_instance_number location = var.location @@ -9,4 +9,16 @@ module "main" { sa_account_tier = var.sa_account_tier sa_account_replication_type = var.sa_account_replication_type sc_container_access_type = var.sc_container_access_type +} + +module "acr" { + source = "../../terraform/modules/acr" + digital_product_affix = var.digital_product_affix_acr_module + environment = var.environment + resource_instance_number = var.resource_instance_number + location = var.location + team = var.team + number_of_container_registries = var.number_of_container_registries + acr_sku = var.acr_sku + acr_admin_enabled = var.acr_admin_enabled } \ No newline at end of file diff --git a/devops/terraform/output.tf b/devops/terraform/output.tf new file mode 100644 index 0000000..2d81cad --- /dev/null +++ b/devops/terraform/output.tf @@ -0,0 +1,13 @@ +# ACR +output "container_registry_admin_username_list" { + value = module.acr.container_registry_admin_username_list +} + +output "container_registry_admin_password_list" { + value = module.acr.container_registry_admin_password_list + sensitive = true +} + +output "container_registry_login_server_list" { + value = module.acr.container_registry_login_server_list +} \ No newline at end of file diff --git a/devops/terraform/variables.tf b/devops/terraform/variables.tf index fb9063d..1641d4c 100644 --- a/devops/terraform/variables.tf +++ b/devops/terraform/variables.tf @@ -1,7 +1,13 @@ # Azure Rg -variable "digital_product_affix" { +variable "digital_product_affix_sa" { default = "gftfbe" - description = "The digital product affix." + description = "The digital product affix of the Storage Account module." + type = string +} + +variable "digital_product_affix_acr_module" { + default = "mlopsftwcr" + description = "The digital product affix of the acr module." type = string } @@ -52,4 +58,23 @@ variable "sc_container_access_type" { default = "private" description = "Container access type of the Storage Account Container" type = string +} + +# Azure Container Registry +variable "number_of_container_registries" { + default = 1 + description = "The total number of Azure Container registries to deploy." + type = number +} + +variable "acr_sku" { + description = "SKU for the Azure Container Registry" + type = string + default = "Basic" +} + +variable "acr_admin_enabled" { + description = "Flag to enable admin user for the Azure Container Registry" + type = bool + default = true } \ No newline at end of file diff --git a/terraform/envs/sbx-k8s-deployment/main.tf b/terraform/envs/sbx-k8s-deployment/main.tf index eb09045..b7650ba 100644 --- a/terraform/envs/sbx-k8s-deployment/main.tf +++ b/terraform/envs/sbx-k8s-deployment/main.tf @@ -1,6 +1,6 @@ module "az" { source = "git::https://github.com/MGTheTrain/gitops-ftw.git//terraform/modules/az?ref=main" - digital_product_affix = var.digital_product_affix_az_module + digital_product_affix = var.digital_product_affix environment = var.environment resource_instance_number = var.resource_instance_number location = var.location @@ -13,16 +13,4 @@ module "az" { aks_max_node_count = var.aks_max_node_count aks_vm_size = var.aks_vm_size aks_os_disk_size_gb = var.aks_os_disk_size_gb -} - -module "acr" { - source = "../../modules/acr" - digital_product_affix = var.digital_product_affix_acr_module - environment = var.environment - resource_instance_number = var.resource_instance_number - location = var.location - team = var.team - number_of_container_registries = var.number_of_container_registries - acr_sku = var.acr_sku - acr_admin_enabled = var.acr_admin_enabled } \ No newline at end of file diff --git a/terraform/envs/sbx-k8s-deployment/output.tf b/terraform/envs/sbx-k8s-deployment/output.tf index e6ce9bc..835651f 100644 --- a/terraform/envs/sbx-k8s-deployment/output.tf +++ b/terraform/envs/sbx-k8s-deployment/output.tf @@ -15,18 +15,4 @@ output "aks_name_list" { output "aks_kube_config_list" { value = module.az.aks_kube_config_list sensitive = true -} - -# ACR -output "container_registry_admin_username_list" { - value = module.acr.container_registry_admin_username_list -} - -output "container_registry_admin_password_list" { - value = module.acr.container_registry_admin_password_list - sensitive = true -} - -output "container_registry_login_server_list" { - value = module.acr.container_registry_login_server_list } \ No newline at end of file diff --git a/terraform/envs/sbx-k8s-deployment/variables.tf b/terraform/envs/sbx-k8s-deployment/variables.tf index 77315ea..ebed6ea 100644 --- a/terraform/envs/sbx-k8s-deployment/variables.tf +++ b/terraform/envs/sbx-k8s-deployment/variables.tf @@ -1,15 +1,9 @@ -variable "digital_product_affix_az_module" { +variable "digital_product_affix" { default = "mlopsftwaz" description = "The digital product affix of the az module." type = string } -variable "digital_product_affix_acr_module" { - default = "mlopsftwcr" - description = "The digital product affix of the acr module." - type = string -} - variable "environment" { default = "sbx" description = "The environment." @@ -80,23 +74,4 @@ variable "aks_os_disk_size_gb" { type = string default = "128" description = "The AKS Agent Operating System disk size in GB" -} - -# Azure Container Registry -variable "number_of_container_registries" { - default = 1 - description = "The total number of Azure Container registries to deploy." - type = number -} - -variable "acr_sku" { - description = "SKU for the Azure Container Registry" - type = string - default = "Basic" -} - -variable "acr_admin_enabled" { - description = "Flag to enable admin user for the Azure Container Registry" - type = bool - default = true } \ No newline at end of file