Skip to content

Commit 3ba3182

Browse files
committed
Fixing ECR policy input type
1 parent 8e7c8c5 commit 3ba3182

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

operations/deployment/terraform/aws/aws_variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1514,7 +1514,7 @@ variable "aws_ecr_repo_read_arn_lambda" {
15141514
variable "aws_ecr_lifecycle_policy_input" {
15151515
description = "The policy document. This is a JSON formatted string. See more details about [Policy Parameters](http://docs.aws.amazon.com/AmazonECR/latest/userguide/LifecyclePolicies.html#lifecycle_policy_parameters) in the official AWS docs"
15161516
type = string
1517-
default = ""
1517+
default = "{}"
15181518
}
15191519

15201520
variable "aws_ecr_public_repo_catalog" {

operations/deployment/terraform/modules/aws/ecr/aws_ecr.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ resource "aws_ecr_repository_policy" "this" {
3636
################################################################################
3737

3838
resource "aws_ecr_lifecycle_policy" "this" {
39-
count = var.aws_ecr_repo_type == "private" && var.aws_ecr_lifecycle_policy_input != "" ? 1 : 0
39+
count = var.aws_ecr_repo_type == "private" && var.aws_ecr_lifecycle_policy_input != "{}" ? 1 : 0
4040

4141
repository = aws_ecr_repository.this[0].name
42-
policy = var.aws_ecr_lifecycle_policy_input
42+
policy = jsondecode(var.aws_ecr_lifecycle_policy_input)
4343
}
4444

4545
################################################################################

0 commit comments

Comments
 (0)