Skip to content

Commit 7a5db8f

Browse files
authored
defaults ecr to immutable (#32)
1 parent 453b6c0 commit 7a5db8f

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

base/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ $ terraform apply
4040
|------|-------------|:----:|:-----:|:-----:|
4141
| app | Name of the application. This value should usually match the application tag below. | string | | yes |
4242
| aws_profile | The AWS profile to use, this would be the same value used in AWS_PROFILE. | string | | yes |
43-
| region | The AWS region to use for the bucket and registry; typically `us-east-1`. Other possible values: `us-east-2`, `us-west-1`, or `us-west-2`. <br>Currently, Fargate is only available in `us-east-1`. | string | `us-east-1` | yes |
43+
| image_tag_mutability | The tag mutability setting for the repository. | string | IMMUTABLE | |
44+
| region | The AWS region to use for the bucket and registry; typically `us-east-1`. Other possible values: `us-east-2`, `us-west-1`, or `us-west-2`. <br>Currently, Fargate is only available in `us-east-1`. | string | `us-east-1` | |
4445
| saml_role | The role that will have access to the S3 bucket, this should be a role that all members of the team have access to. | string | | yes |
4546
| tags | A map of the tags to apply to various resources. The required tags are: <br>+ `application`, name of the app <br>+ `environment`, the environment being created <br>+ `team`, team responsible for the application <br>+ `contact-email`, contact email for the _team_ <br>+ `customer`, who the application was create for | map | `<map>` | yes |
4647

base/ecr.tf

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,17 @@
44
* https://aws.amazon.com/ecr/
55
*/
66

7+
# The tag mutability setting for the repository (defaults to IMMUTABLE)
8+
variable "image_tag_mutability" {
9+
type = string
10+
default = "IMMUTABLE"
11+
description = "The tag mutability setting for the repository (defaults to IMMUTABLE)"
12+
}
13+
714
# create an ECR repo at the app/image level
815
resource "aws_ecr_repository" "app" {
9-
name = var.app
16+
name = var.app
17+
image_tag_mutability = var.image_tag_mutability
1018
}
1119

1220
data "aws_caller_identity" "current" {

base/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ terraform {
1313
# Using the AWS Provider
1414
# https://www.terraform.io/docs/providers/
1515
provider "aws" {
16+
version = ">= 2.23.0"
1617
region = var.region
1718
profile = var.aws_profile
1819
}

0 commit comments

Comments
 (0)