-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #717 from sapuri/terraform/artifact-cleanup-policy
terraform: upgrade google provider and set cleanup policies to artifact registry
- Loading branch information
Showing
3 changed files
with
61 additions
and
13 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
39 changes: 39 additions & 0 deletions
39
terraform/production/google_artifact_registry_repository.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} | ||
} |