Skip to content

Commit

Permalink
feat(artifacts-registry): make more configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
eleonov committed Oct 19, 2023
1 parent 2d4efaa commit 071d9c5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/artifacts-registry/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ resource "google_artifact_registry_repository" "docker_repository" {
for_each = toset(var.docker_repository_ids)
project = var.project_id
provider = google-beta
location = "europe-west2"
location = var.location
repository_id = each.value
description = "Managed by Terraform"
format = "DOCKER"
Expand All @@ -28,7 +28,7 @@ resource "google_artifact_registry_repository" "docker_repository" {
id = "keep-minimum-versions"
action = "KEEP"
most_recent_versions {
keep_count = 10
keep_count = var.keep_count
}
}
}
6 changes: 6 additions & 0 deletions modules/artifacts-registry/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ variable "location" {
description = "The name of the location this repository is located in"
}

variable "keep_count" {
default = 10
type = number
description = "Number of most recent versions to keep"
}

variable "project_id" {
type = string
description = "Project id where service account will be created"
Expand Down

0 comments on commit 071d9c5

Please sign in to comment.