Skip to content

Commit

Permalink
* 2.2.2 -- 2024-07-29
Browse files Browse the repository at this point in the history
  - only process image_config if enabled (default)
  • Loading branch information
badra001 committed Jul 29, 2024
1 parent cd1f041 commit abfcc34
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@

* 2.2.1 -- 2024-07-19
- add force_delete to destory a repo even if it has images (default false)

* 2.2.2 -- 2024-07-29
- only process image_config if enabled (default)
5 changes: 3 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ locals {
dest_registry = local.account_ecr_registry,
dest_full_path = format("%v/%v/%v:%v", local.account_ecr_registry, local.repo_parent_name, i.name, i.tag),
dest_repository = format("%v/%v", local.repo_parent_name, i.name),
enabled = try(i.enabled, true),
})) } : {}
image_map = { for k in distinct([for v in var.image_config : v.name]) : k => format("%v/%v", local.repo_parent_name, k) }
image_repos = { for k, v in local.images : k => format("%v/%v", local.account_ecr, v.name) }
Expand All @@ -272,7 +273,7 @@ locals {
# create repos for image_config
#---
resource "aws_ecr_repository" "image_repos" {
for_each = local.image_map
for_each = { for k, v in local.image_map : k => v if v.enabled }
name = format("%v/%v", local.repo_parent_name, each.key)

image_tag_mutability = "IMMUTABLE"
Expand Down Expand Up @@ -327,5 +328,5 @@ resource "null_resource" "copy_images" {

output "image_map" {
description = "image_config map of name => repo to be used for imports"
value = local.image_map
value = { for k, v in local.image_map : k => v if v.enabled }
}
2 changes: 1 addition & 1 deletion version.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
locals {
_module_name = "aws-ecr-copy-images"
_module_version = "2.2.1"
_module_version = "2.2.2"
}

0 comments on commit abfcc34

Please sign in to comment.