Skip to content

Commit cc4dbfa

Browse files
committed
Update condition to work with older tf
1 parent e7403bf commit cc4dbfa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎main.tf‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ resource "aws_lambda_function" "main" {
324324
error_message = "Secret values must not contain single quotes or newlines: they are written to a dotenv secret."
325325
}
326326
precondition {
327-
condition = var.image_uri == null || startswith(var.image_uri, "${data.aws_caller_identity.current.account_id}.dkr.ecr.${data.aws_region.current.region}.amazonaws.com/")
327+
condition = var.image_uri == null ? true : startswith(var.image_uri,"${data.aws_caller_identity.current.account_id}.dkr.ecr.${data.aws_region.current.region}.amazonaws.com/")
328328
error_message = "image_uri must be an ECR image in this account and region (<account>.dkr.ecr.<region>.amazonaws.com/...): Lambda cannot run images from other registries, accounts or regions."
329329
}
330330
}

0 commit comments

Comments
 (0)