Skip to content

Commit

Permalink
* 2.2.1 -- 2024-07-19
Browse files Browse the repository at this point in the history
  - add force_delete to destory a repo even if it has images (default false)
  • Loading branch information
badra001 committed Jul 19, 2024
1 parent 46e0cad commit 2de7cbe
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@
- add feature for doing ecr lifecycle policy for image_config
- variable enable_lifecycle_policy_image_config
- variable lifecycle_policy_keep_count

* 2.2.1 -- 2024-07-19
- add force_delete to destory a repo even if it has images (default false)
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ No modules.
| <a name="input_destination_username"></a> [destination\_username](#input\_destination\_username) | OCI destination repository username | `string` | `null` | no |
| <a name="input_enable_lifecycle_policy"></a> [enable\_lifecycle\_policy](#input\_enable\_lifecycle\_policy) | Flag to enable/disable ECR lifecycle policy. If enabled, default is 5 most recent images (count) | `bool` | `false` | no |
| <a name="input_enable_lifecycle_policy_image_config"></a> [enable\_lifecycle\_policy\_image\_config](#input\_enable\_lifecycle\_policy\_image\_config) | Flag to enable/disable ECR lifecycle policy for images in the image\_config. If enabled, it will keep lifecycle\_policy\_keep\_count (default: 5) images | `bool` | `true` | no |
| <a name="input_force_delete"></a> [force\_delete](#input\_force\_delete) | Flag to force delete of a repository even if contains images (warning!) | `bool` | `false` | no |
| <a name="input_image_config"></a> [image\_config](#input\_image\_config) | List of image configuration objects to copy from SOURCE to DESTINATION | <pre>list(object({<br> name = string,<br> tag = string,<br> dest_path = string,<br> source_registry = string,<br> source_image = string,<br> source_tag = string,<br> enabled = bool,<br> }))</pre> | `[]` | no |
| <a name="input_lifecycle_policy_all"></a> [lifecycle\_policy\_all](#input\_lifecycle\_policy\_all) | Flag to enable the same default policy (any, count of 5) if true | `bool` | `false` | no |
| <a name="input_lifecycle_policy_default"></a> [lifecycle\_policy\_default](#input\_lifecycle\_policy\_default) | Object with settings for selecting repositories to apply a policy for 'any'. Select repo list and number of images to keep (default: 5). | <pre>object({<br> repos = list(string)<br> count = optional(number, 5)<br> })</pre> | <pre>{<br> "count": 5,<br> "repos": []<br>}</pre> | no |
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ resource "aws_ecr_repository" "image_repos" {
image_scanning_configuration {
scan_on_push = true
}
force_delete = var.force_delete

encryption_configuration {
encryption_type = "KMS"
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,9 @@ variable "lifecycle_policy_explicit" {
policy = null
}
}

variable "force_delete" {
description = "Flag to force delete of a repository even if contains images (warning!)"
type = bool
default = false
}
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.0"
_module_version = "2.2.1"
}

0 comments on commit 2de7cbe

Please sign in to comment.