Skip to content

Commit

Permalink
Merge pull request #717 from sapuri/terraform/artifact-cleanup-policy
Browse files Browse the repository at this point in the history
terraform: upgrade google provider and set cleanup policies to artifact registry
  • Loading branch information
sapuri authored Feb 18, 2024
2 parents 88af8f0 + 5cc36e8 commit ab72dca
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 13 deletions.
27 changes: 14 additions & 13 deletions terraform/production/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions terraform/production/google_artifact_registry_repository.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
resource "google_artifact_registry_repository" "app" {
location = local.region
repository_id = "app"
format = "DOCKER"
cleanup_policies {
id = "delete"
action = "DELETE"
condition {
older_than = "86400s" # 1 day
}
}
cleanup_policies {
id = "keep-minimum-versions"
action = "KEEP"
most_recent_versions {
keep_count = 1
}
}
}

resource "google_artifact_registry_repository" "cmd" {
location = local.region
repository_id = "cmd"
format = "DOCKER"
cleanup_policies {
id = "delete"
action = "DELETE"
condition {
older_than = "86400s" # 1 day
}
}
cleanup_policies {
id = "keep-minimum-versions"
action = "KEEP"
most_recent_versions {
keep_count = 1
}
}
}
8 changes: 8 additions & 0 deletions terraform/production/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.16.0"
}
}
}

0 comments on commit ab72dca

Please sign in to comment.