From 90e5582ee8641f5449522379e00f79810b4eef21 Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Sun, 20 Apr 2025 16:10:17 -0400 Subject: [PATCH] use try --- copy_images.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/copy_images.tf b/copy_images.tf index 7efe5e5..48bfc4c 100644 --- a/copy_images.tf +++ b/copy_images.tf @@ -54,8 +54,8 @@ module "images" { force_delete = true lifecycle_policy_keep_count = 5 - source_username = local.image_config.source_username || "" - source_password = local.image_config.source_password || "" + source_username = try(local.image_config.source_username, data.aws_ecr_authorization_token.token.user_name) + source_password = try(local.image_config.source_password, data.aws_ecr_authorization_token.token.password) destination_username = data.aws_ecr_authorization_token.token.user_name destination_password = data.aws_ecr_authorization_token.token.password