Skip to content

Commit 953ccee

Browse files
authored
feat!: Updated AWS provider to v4, added ECR repo force_delete argument in docker-build module (#337)
1 parent 9d16478 commit 953ccee

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

modules/docker-build/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ module "docker_image" {
5353
| Name | Version |
5454
|------|---------|
5555
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
56-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.35 |
56+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.22 |
5757
| <a name="requirement_docker"></a> [docker](#requirement\_docker) | >= 2.12 |
5858

5959
## Providers
6060

6161
| Name | Version |
6262
|------|---------|
63-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.35 |
63+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.22 |
6464
| <a name="provider_docker"></a> [docker](#provider\_docker) | >= 2.12 |
6565

6666
## Modules
@@ -85,6 +85,7 @@ No modules.
8585
| <a name="input_create_ecr_repo"></a> [create\_ecr\_repo](#input\_create\_ecr\_repo) | Controls whether ECR repository for Lambda image should be created | `bool` | `false` | no |
8686
| <a name="input_docker_file_path"></a> [docker\_file\_path](#input\_docker\_file\_path) | Path to Dockerfile in source package | `string` | `"Dockerfile"` | no |
8787
| <a name="input_ecr_address"></a> [ecr\_address](#input\_ecr\_address) | Address of ECR repository for cross-account container image pulling (optional). Option `create_ecr_repo` must be `false` | `string` | `null` | no |
88+
| <a name="input_ecr_force_delete"></a> [ecr\_force\_delete](#input\_ecr\_force\_delete) | If true, will delete the repository even if it contains images. | `bool` | `true` | no |
8889
| <a name="input_ecr_repo"></a> [ecr\_repo](#input\_ecr\_repo) | Name of ECR repository to use or to create | `string` | `null` | no |
8990
| <a name="input_ecr_repo_lifecycle_policy"></a> [ecr\_repo\_lifecycle\_policy](#input\_ecr\_repo\_lifecycle\_policy) | A JSON formatted ECR lifecycle policy to automate the cleaning up of unused images. | `string` | `null` | no |
9091
| <a name="input_ecr_repo_tags"></a> [ecr\_repo\_tags](#input\_ecr\_repo\_tags) | A map of tags to assign to ECR repository | `map(string)` | `{}` | no |

modules/docker-build/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ resource "docker_registry_image" "this" {
2424
resource "aws_ecr_repository" "this" {
2525
count = var.create_ecr_repo ? 1 : 0
2626

27+
force_delete = var.ecr_force_delete
2728
name = var.ecr_repo
2829
image_tag_mutability = var.image_tag_mutability
2930

modules/docker-build/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ variable "scan_on_push" {
4747
default = false
4848
}
4949

50+
variable "ecr_force_delete" {
51+
description = "If true, will delete the repository even if it contains images."
52+
default = true
53+
type = bool
54+
}
55+
5056
variable "ecr_repo_tags" {
5157
description = "A map of tags to assign to ECR repository"
5258
type = map(string)

modules/docker-build/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 3.35"
7+
version = ">= 4.22"
88
}
99
docker = {
1010
source = "kreuzwerker/docker"

0 commit comments

Comments
 (0)