Skip to content

Commit

Permalink
Add tag mutability setting to the module (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
SaiKiranBurle authored Feb 28, 2020
1 parent 2868a6d commit 4f3824a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ Available targets:
| delimiter | Delimiter to be used between `name`, `namespace`, `stage`, etc. | string | `-` | no |
| enabled | Set to false to prevent the module from creating any resources | bool | `true` | no |
| image_names | List of Docker local image names, used as repository names for AWS ECR | list(string) | `<list>` | no |
| image_tag_mutability | The tag mutability setting for the repository. Must be one of: `MUTABLE` or `IMMUTABLE` | string | `MUTABLE` | no |
| max_image_count | How many Docker Image versions AWS ECR will store | string | `500` | no |
| name | The Name of the application or solution (e.g. `bastion` or `portal`) | string | - | yes |
| namespace | Namespace (e.g. `eg` or `cp`) | string | `` | no |
Expand Down
1 change: 1 addition & 0 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
| delimiter | Delimiter to be used between `name`, `namespace`, `stage`, etc. | string | `-` | no |
| enabled | Set to false to prevent the module from creating any resources | bool | `true` | no |
| image_names | List of Docker local image names, used as repository names for AWS ECR | list(string) | `<list>` | no |
| image_tag_mutability | The tag mutability setting for the repository. Must be one of: `MUTABLE` or `IMMUTABLE` | string | `MUTABLE` | no |
| max_image_count | How many Docker Image versions AWS ECR will store | string | `500` | no |
| name | The Name of the application or solution (e.g. `bastion` or `portal`) | string | - | yes |
| namespace | Namespace (e.g. `eg` or `cp`) | string | `` | no |
Expand Down
5 changes: 3 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ locals {
}

resource "aws_ecr_repository" "default" {
count = var.enabled ? length(local.image_names) : 0
name = local.image_names[count.index]
count = var.enabled ? length(local.image_names) : 0
name = local.image_names[count.index]
image_tag_mutability = var.image_tag_mutability

image_scanning_configuration {
scan_on_push = var.scan_images_on_push
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,9 @@ variable "image_names" {
default = []
description = "List of Docker local image names, used as repository names for AWS ECR "
}

variable "image_tag_mutability" {
type = string
default = "MUTABLE"
description = "The tag mutability setting for the repository. Must be one of: `MUTABLE` or `IMMUTABLE`"
}

0 comments on commit 4f3824a

Please sign in to comment.