From 3d57bc9062136bf1db1b329dfdc6c00e041a4094 Mon Sep 17 00:00:00 2001 From: Konstantin Tarkus Date: Sun, 4 Feb 2024 23:04:36 +0100 Subject: [PATCH] feat(infra): Docker registry configuration --- infra/core/{storage.tf => artifacts.tf} | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) rename infra/core/{storage.tf => artifacts.tf} (52%) diff --git a/infra/core/storage.tf b/infra/core/artifacts.tf similarity index 52% rename from infra/core/storage.tf rename to infra/core/artifacts.tf index c82ec10f..874ff078 100644 --- a/infra/core/storage.tf +++ b/infra/core/artifacts.tf @@ -1,4 +1,25 @@ -# Google Cloud Storage +# Cloud Storage for Build Artifacts + +# Docker Registry +# https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/artifact_registry_repository +resource "google_artifact_registry_repository" "cloud_run" { + location = var.gcp_region + repository_id = "cloud-run" + description = "Docker repository for Cloud Run services." + format = "DOCKER" + + cleanup_policies { + id = "cloud-run-cleanup" + action = "KEEP" + + most_recent_versions { + keep_count = 2 + } + } +} + +# Cloud Storage Bucket +# https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/storage_bucket # # NOTE: The Google account under which the Terraform Cloud agents run must have # the owner role on the target domain name in order to create Google Cloud @@ -6,7 +27,6 @@ # members in the Google Search Console at the following URL: # https://search.google.com/search-console/welcome?new_domain_name=example.com # https://cloud.google.com/storage/docs/domain-name-verification - resource "google_storage_bucket" "pkg" { name = "pkg.${var.root_level_domain}" location = var.gcp_region