From 67210475cd8c58ebd59537b5c14715089376f889 Mon Sep 17 00:00:00 2001 From: fmadjdian Date: Thu, 23 Feb 2023 12:53:25 +0100 Subject: [PATCH 1/2] [TERRAFORM] Added jsonencode to nonsensitive parameter For the parameters in the SSM store we need to add a jsonencode to fetch sensitive data. --- .../ecs_services/service_configuration/outputs.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/application_services/ecs_services/service_configuration/outputs.tf b/terraform/application_services/ecs_services/service_configuration/outputs.tf index 8e368c9..1df53b0 100644 --- a/terraform/application_services/ecs_services/service_configuration/outputs.tf +++ b/terraform/application_services/ecs_services/service_configuration/outputs.tf @@ -5,7 +5,7 @@ output "services" { APP_VERSION = var.app_version, REGISTRY_URL = var.ecr_directory == null ? "${var.ecr_repo}/${lower(var.environment)}" : "${var.ecr_repo}/${var.ecr_directory}", - BING_APIKEY = nonsensitive(data.aws_ssm_parameter.bing_apikey_search) + BING_APIKEY = jsonencode(nonsensitive(data.aws_ssm_parameter.bing_apikey_search)) })).services } From a862aaf688102c5dad73005c5c08cfd4dadd4657 Mon Sep 17 00:00:00 2001 From: fmadjdian Date: Thu, 23 Feb 2023 13:04:29 +0100 Subject: [PATCH 2/2] [TERRAFORM] Fix in value designation We needed to point to the value inside the key-value pair. jsonencode isn't necessary.. --- .../ecs_services/service_configuration/outputs.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/application_services/ecs_services/service_configuration/outputs.tf b/terraform/application_services/ecs_services/service_configuration/outputs.tf index 1df53b0..9a5e25c 100644 --- a/terraform/application_services/ecs_services/service_configuration/outputs.tf +++ b/terraform/application_services/ecs_services/service_configuration/outputs.tf @@ -5,7 +5,7 @@ output "services" { APP_VERSION = var.app_version, REGISTRY_URL = var.ecr_directory == null ? "${var.ecr_repo}/${lower(var.environment)}" : "${var.ecr_repo}/${var.ecr_directory}", - BING_APIKEY = jsonencode(nonsensitive(data.aws_ssm_parameter.bing_apikey_search)) + BING_APIKEY = nonsensitive(data.aws_ssm_parameter.bing_apikey_search.value) })).services }