diff --git a/azure/terraform/modules/gitlab/main.tf b/azure/terraform/modules/gitlab/main.tf index 5ce67c3..47468eb 100644 --- a/azure/terraform/modules/gitlab/main.tf +++ b/azure/terraform/modules/gitlab/main.tf @@ -1,51 +1,52 @@ resource "azurerm_resource_group" "gitlab_rg" { name = var.name location = var.location tags = { environment = "gitlab" } } # kubernetes cluster for compute and storage module "gitlab_aks_cluster" { source = "../kubernetes" cluster_name = var.name resource_group = var.name minimal_pool_count = 1 maximal_pool_count = 5 node_type = "Standard_B2ms" depends_on = [ azurerm_resource_group.gitlab_rg ] } # Storage account for the assets # git lfs / backups / artifacts / pages # terraform states / registry / ... resource "azurerm_storage_account" "gitlab_storage" { name = var.blob_storage_name resource_group_name = var.name location = var.location account_tier = "Standard" account_replication_type = "LRS" blob_properties { delete_retention_policy { days = 7 } } tags = { environment = "gitlab" } } resource "azurerm_storage_container" "gitlab_storage_container" { - name = "gitlab-content" + count = length(var.blob_storage_containers) + name = var.blob_storage_containers[count.index] storage_account_name = azurerm_storage_account.gitlab_storage.name container_access_type = "private" } diff --git a/azure/terraform/modules/gitlab/variables.tf b/azure/terraform/modules/gitlab/variables.tf index 7b187d4..8d22888 100644 --- a/azure/terraform/modules/gitlab/variables.tf +++ b/azure/terraform/modules/gitlab/variables.tf @@ -1,15 +1,24 @@ variable "name" { description = "Name of the gitlab environment" type = string } variable "location" { description = "Name of the gitlab environment" type = string default = "westeurope" } variable "blob_storage_name" { description = "Blob storage name. lower case, only letters and numbers" type = string } + +variable "blob_storage_containers" { + description = "Blob storage containers to create on the storage account" + type = list(string) + default = [ + "artifacts", "registry", "external-diffs", "lfs-objects", "uploads", + "packages", "dependency-proxy", "terraform", "pages", + ] +}