Skip to content

Commit 8621e19

Browse files
committed
Adding encryption_type to allow using kms without passing key id and adding ecr:ListImages for argocd-image-updater
1 parent 6c06ca0 commit 8621e19

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

_variables.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ variable "trust_accounts" {
77
description = "Accounts to trust and allow ECR fetch"
88
}
99

10+
variable "encryption_type" {
11+
type = string
12+
description = "Encryption type, KMS or AES256. When kms_key_arn is passed, encryption_type is always KMS"
13+
default = "KMS"
14+
}
15+
1016
variable "kms_key_arn" {
1117
type = string
1218
description = "KMS Key ARN to use a CMK instead of default key"
@@ -35,4 +41,4 @@ variable "tags" {
3541
description = "Map of tags that will be added to created resources. By default resources will be tagged with name and environment."
3642
type = map(string)
3743
default = {}
38-
}
44+
}

ecr-policies.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ data "aws_iam_policy_document" "default" {
2121
"ecr:GetDownloadUrlForLayer",
2222
"ecr:BatchGetImage",
2323
"ecr:BatchCheckLayerAvailability",
24-
"ecr:DescribeImageScanFindings"
24+
"ecr:DescribeImageScanFindings",
25+
"ecr:ListImages"
2526
]
2627
}
2728
}

ecr-repositories.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ resource "aws_ecr_repository" "default" {
33
image_tag_mutability = var.image_tag_mutability
44

55
encryption_configuration {
6-
encryption_type = var.kms_key_arn != "" ? "KMS" : "AES256"
6+
encryption_type = var.kms_key_arn != "" ? "KMS" : var.encryption_type
77
kms_key = var.kms_key_arn
88
}
99

0 commit comments

Comments
 (0)