Skip to content

Commit 83830eb

Browse files
authoredDec 11, 2024··
Adding encryption_type to allow using kms without passing key id and adding ecr:ListImages for argocd-image-updater (#21)
* Adding encryption_type to allow using kms without passing key id and adding ecr:ListImages for argocd-image-updater * terraform-docs: automated update action --------- Co-authored-by: adenot <adenot@users.noreply.github.com>
1 parent 6c06ca0 commit 83830eb

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed
 

‎README.md

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ The following resources will be created:
3131

3232
| Name | Description | Type | Default | Required |
3333
|------|-------------|------|---------|:--------:|
34+
| encryption\_type | Encryption type, KMS or AES256. When kms\_key\_arn is passed, encryption\_type is always KMS | `string` | `"KMS"` | no |
3435
| image\_tag\_mutability | The tag mutability setting for the repository. Must be one of: MUTABLE or IMMUTABLE. Defaults to MUTABLE. | `string` | `"MUTABLE"` | no |
3536
| kms\_key\_arn | KMS Key ARN to use a CMK instead of default key | `string` | `""` | no |
3637
| lifecycle\_policy | JSON formatted string ECR repository lifecycle policy. | `string` | `""` | no |

‎_variables.tf

+7-1
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

+2-1
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

+1-1
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)
Please sign in to comment.