diff --git a/CHANGELOG.md b/CHANGELOG.md index 7631398..af0f679 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/README.md b/README.md index 86b2745..6fb063a 100644 --- a/README.md +++ b/README.md @@ -249,6 +249,7 @@ No modules. | [destination\_username](#input\_destination\_username) | OCI destination repository username | `string` | `null` | no | | [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 | | [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 | +| [force\_delete](#input\_force\_delete) | Flag to force delete of a repository even if contains images (warning!) | `bool` | `false` | no | | [image\_config](#input\_image\_config) | List of image configuration objects to copy from SOURCE to DESTINATION |
list(object({
name = string,
tag = string,
dest_path = string,
source_registry = string,
source_image = string,
source_tag = string,
enabled = bool,
}))
| `[]` | no | | [lifecycle\_policy\_all](#input\_lifecycle\_policy\_all) | Flag to enable the same default policy (any, count of 5) if true | `bool` | `false` | no | | [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). |
object({
repos = list(string)
count = optional(number, 5)
})
|
{
"count": 5,
"repos": []
}
| no | diff --git a/main.tf b/main.tf index 9d1bf3a..68e0af3 100644 --- a/main.tf +++ b/main.tf @@ -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" diff --git a/variables.tf b/variables.tf index b64eadb..2ef6dca 100644 --- a/variables.tf +++ b/variables.tf @@ -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 +} diff --git a/version.tf b/version.tf index ac712ee..0a8d3e9 100644 --- a/version.tf +++ b/version.tf @@ -1,4 +1,4 @@ locals { _module_name = "aws-ecr-copy-images" - _module_version = "2.2.0" + _module_version = "2.2.1" }