-
Notifications
You must be signed in to change notification settings - Fork 4
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 #28 from mineiros-io/lukas/add-cleanup-policy
feat: add cleanup policies
- Loading branch information
Showing
10 changed files
with
264 additions
and
18 deletions.
There are no files selected for viewing
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
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
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
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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module "test-sa" { | ||
source = "github.com/mineiros-io/terraform-google-service-account?ref=v0.0.10" | ||
source = "github.com/mineiros-io/terraform-google-service-account?ref=v0.2.1" | ||
|
||
account_id = "service-account-id-${local.random_suffix}" | ||
} | ||
|
@@ -193,5 +193,51 @@ module "test2" { | |
} | ||
|
||
module_depends_on = ["nothing"] | ||
} | ||
|
||
module "cleanup_policies" { | ||
source = "../.." | ||
|
||
module_enabled = true | ||
|
||
repository_id = "unit-complete-2-${local.random_suffix}" | ||
format = "NPM" | ||
location = "europe-west3" | ||
|
||
policy_bindings = [ | ||
{ | ||
role = "roles/artifactregistry.reader" | ||
members = [ | ||
"user:[email protected]", | ||
"computed:myserviceaccount", | ||
] | ||
} | ||
] | ||
|
||
description = "An artifact registry created by an automated unit-test in https://github.com/mineiros-io/terraform-google-artifact-registry-repository." | ||
|
||
project = var.gcp_project | ||
|
||
cleanup_policy_dry_run = true | ||
cleanup_policies = [ | ||
{ | ||
id = "delete-prerelease" | ||
action = "DELETE" | ||
condition = { | ||
tag_state = "TAGGED" | ||
tag_prefixes = ["alpha", "v0"] | ||
version_name_prefixes = ["prefix1", "prefix2"] | ||
package_name_prefixes = ["prefix1", "prefix2"] | ||
older_than = "2592000s" | ||
newer_than = "1d" | ||
} | ||
most_recent_versions = { | ||
package_name_prefixes = ["prefix1", "prefix2"] | ||
keep_count = 1 | ||
} | ||
} | ||
] | ||
|
||
module_depends_on = ["nothing"] | ||
} | ||
|
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
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
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
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
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