Skip to content

Commit

Permalink
feat!: Updated AWS provider to v4, added ECR repo force_delete argume…
Browse files Browse the repository at this point in the history
…nt in docker-build module (#337)
  • Loading branch information
1Mill authored Aug 18, 2022
1 parent 9d16478 commit 953ccee
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
5 changes: 3 additions & 2 deletions modules/docker-build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ module "docker_image" {
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.35 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.22 |
| <a name="requirement_docker"></a> [docker](#requirement\_docker) | >= 2.12 |

## Providers

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

## Modules
Expand All @@ -85,6 +85,7 @@ No modules.
| <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 |
| <a name="input_docker_file_path"></a> [docker\_file\_path](#input\_docker\_file\_path) | Path to Dockerfile in source package | `string` | `"Dockerfile"` | no |
| <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 |
| <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 |
| <a name="input_ecr_repo"></a> [ecr\_repo](#input\_ecr\_repo) | Name of ECR repository to use or to create | `string` | `null` | no |
| <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 |
| <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 |
Expand Down
1 change: 1 addition & 0 deletions modules/docker-build/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ resource "docker_registry_image" "this" {
resource "aws_ecr_repository" "this" {
count = var.create_ecr_repo ? 1 : 0

force_delete = var.ecr_force_delete
name = var.ecr_repo
image_tag_mutability = var.image_tag_mutability

Expand Down
6 changes: 6 additions & 0 deletions modules/docker-build/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ variable "scan_on_push" {
default = false
}

variable "ecr_force_delete" {
description = "If true, will delete the repository even if it contains images."
default = true
type = bool
}

variable "ecr_repo_tags" {
description = "A map of tags to assign to ECR repository"
type = map(string)
Expand Down
2 changes: 1 addition & 1 deletion modules/docker-build/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 3.35"
version = ">= 4.22"
}
docker = {
source = "kreuzwerker/docker"
Expand Down

0 comments on commit 953ccee

Please sign in to comment.