diff --git a/infra/modules/object-storage/main.tf b/infra/modules/object-storage/main.tf index a1fc880b7..1d4c386d0 100644 --- a/infra/modules/object-storage/main.tf +++ b/infra/modules/object-storage/main.tf @@ -15,3 +15,30 @@ resource "scaleway_object_bucket" "artifacts" { enabled = false } } + +resource "scaleway_object_bucket" "gitlab_registry" { + name = "${var.bucket_name_prefix}-gitlab-registry" + region = var.region + + versioning { + enabled = false + } +} + +resource "scaleway_object_bucket" "gitlab_artifacts" { + name = "${var.bucket_name_prefix}-gitlab-artifacts" + region = var.region + + lifecycle_rule { + enabled = true + prefix = "tmp/" + + expiration { + days = 7 + } + } + + versioning { + enabled = false + } +} diff --git a/infra/modules/object-storage/outputs.tf b/infra/modules/object-storage/outputs.tf index 7df47b660..35d7c88bd 100644 --- a/infra/modules/object-storage/outputs.tf +++ b/infra/modules/object-storage/outputs.tf @@ -7,3 +7,18 @@ output "endpoint" { description = "S3-compatible endpoint URL for the bucket region" value = "https://s3.${var.region}.scw.cloud" } + +output "artifacts_bucket_name" { + description = "Name of the main artifacts bucket" + value = scaleway_object_bucket.artifacts.name +} + +output "gitlab_registry_bucket_name" { + description = "Name of the GitLab registry bucket" + value = scaleway_object_bucket.gitlab_registry.name +} + +output "gitlab_artifacts_bucket_name" { + description = "Name of the GitLab artifacts bucket" + value = scaleway_object_bucket.gitlab_artifacts.name +} diff --git a/infra/modules/object-storage/variables.tf b/infra/modules/object-storage/variables.tf index b658d4f41..6a87bb178 100644 --- a/infra/modules/object-storage/variables.tf +++ b/infra/modules/object-storage/variables.tf @@ -8,3 +8,9 @@ variable "bucket_name" { type = string default = "foxhunt-artifacts" } + +variable "bucket_name_prefix" { + description = "Prefix for additional buckets (e.g., foxhunt)" + type = string + default = "foxhunt" +}