From b4f28146703c503d0aade0a369b52ba227ef8552 Mon Sep 17 00:00:00 2001 From: Mark Mandel Date: Fri, 24 Feb 2023 15:15:19 -0800 Subject: [PATCH] Create a docker artifact registry (#77) Now we have somewhere to store our container images! Closes #54 --- infrastructure/artifact-registry.tf | 20 ++++++++++++++++++++ infrastructure/terraform.tfvars.sample | 5 +++++ infrastructure/variables.tf | 8 ++++++++ 3 files changed, 33 insertions(+) create mode 100644 infrastructure/artifact-registry.tf diff --git a/infrastructure/artifact-registry.tf b/infrastructure/artifact-registry.tf new file mode 100644 index 0000000..e46978d --- /dev/null +++ b/infrastructure/artifact-registry.tf @@ -0,0 +1,20 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +resource "google_artifact_registry_repository" "container_registry" { + repository_id = "global-game-images" + location = var.artifact_registry_config.location + description = "Repository for container images for the global game" + format = "Docker" +} diff --git a/infrastructure/terraform.tfvars.sample b/infrastructure/terraform.tfvars.sample index 1136cdf..6d11912 100644 --- a/infrastructure/terraform.tfvars.sample +++ b/infrastructure/terraform.tfvars.sample @@ -105,6 +105,11 @@ services_gke_config = { } } +# Artifact Registry variables +artifact_registry_config = { + location = "us-central1" +} + # Agones Application Service Account Name app_service_account_config = { name = "app-service-account" diff --git a/infrastructure/variables.tf b/infrastructure/variables.tf index c774c74..69d468d 100644 --- a/infrastructure/variables.tf +++ b/infrastructure/variables.tf @@ -52,6 +52,14 @@ variable "clouddeploy_config" { }) } +### Artifact Registry Variables ### + +variable "artifact_registry_config" { + type = object({ + location = string + }) +} + ### Spanner Variables ### variable "spanner_config" {