From dbc2719b402b1667563ee533b5119c12cf680492 Mon Sep 17 00:00:00 2001 From: Wai Phyo Date: Thu, 11 Apr 2024 16:00:37 -0700 Subject: [PATCH 1/3] feat: add healthcheck url --- tf-module/unity-cumulus/main.tf | 7 +++++++ tf-module/unity-cumulus/variables.tf | 13 +++++++++++++ 2 files changed, 20 insertions(+) diff --git a/tf-module/unity-cumulus/main.tf b/tf-module/unity-cumulus/main.tf index b753b6ff..3d18cc64 100644 --- a/tf-module/unity-cumulus/main.tf +++ b/tf-module/unity-cumulus/main.tf @@ -170,4 +170,11 @@ resource "aws_ssm_parameter" "uds_api_1" { name = "/unity/unity-ds/api-gateway/integrations/${var.prefix}-uds_api_1-function-name" type = "String" value = aws_lambda_function.uds_api_1.function_name +} + + + resource "aws_ssm_parameter" "health_check_value" { + name = "/unity/healthCheck/${var.health_check_marketplace_item}/${var.health_check_component_name}/url" + type = "String" + value = "${var.uds_base_url}/${var.dapa_api_prefix}/collections" } \ No newline at end of file diff --git a/tf-module/unity-cumulus/variables.tf b/tf-module/unity-cumulus/variables.tf index 4c551400..0bc48099 100644 --- a/tf-module/unity-cumulus/variables.tf +++ b/tf-module/unity-cumulus/variables.tf @@ -165,4 +165,17 @@ variable "cors_integration_response" { "method.response.header.Access-Control-Expose-Headers" = "'Access-Control-Allow-Methods,Access-Control-Expose-Headers,Access-Control-Max-Age'" "method.response.header.Access-Control-Max-Age" = "'300'" } +} + + +variable "health_check_marketplace_item" { + type = string + default = "shared-services" + description = "name of the portion of market place item as path of SSM token" +} + +variable "health_check_component_name" { + type = string + default = "data-catalog" + description = "name of the portion of market place item as path of SSM token" } \ No newline at end of file From 3324696bc49b0bcb24b15606aaf121151b1a9dd5 Mon Sep 17 00:00:00 2001 From: Wai Phyo Date: Thu, 11 Apr 2024 16:58:57 -0700 Subject: [PATCH 2/3] fix: conditionally deploy healthcheck --- tf-module/unity-cumulus/main.tf | 1 + tf-module/unity-cumulus/variables.tf | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/tf-module/unity-cumulus/main.tf b/tf-module/unity-cumulus/main.tf index 3d18cc64..cdf304a3 100644 --- a/tf-module/unity-cumulus/main.tf +++ b/tf-module/unity-cumulus/main.tf @@ -174,6 +174,7 @@ resource "aws_ssm_parameter" "uds_api_1" { resource "aws_ssm_parameter" "health_check_value" { + count = var.is_deploying_healthcheck ? 1 : 0 name = "/unity/healthCheck/${var.health_check_marketplace_item}/${var.health_check_component_name}/url" type = "String" value = "${var.uds_base_url}/${var.dapa_api_prefix}/collections" diff --git a/tf-module/unity-cumulus/variables.tf b/tf-module/unity-cumulus/variables.tf index 0bc48099..41a2c19d 100644 --- a/tf-module/unity-cumulus/variables.tf +++ b/tf-module/unity-cumulus/variables.tf @@ -178,4 +178,10 @@ variable "health_check_component_name" { type = string default = "data-catalog" description = "name of the portion of market place item as path of SSM token" +} + +variable "is_deploying_healthcheck" { + type = bool + default = true + description = "flag to specify if deploying health check" } \ No newline at end of file From 842aac9b3afc6ca1ef38ce544c7b3e15ada1c08d Mon Sep 17 00:00:00 2001 From: Wai Phyo Date: Mon, 15 Apr 2024 11:37:38 -0700 Subject: [PATCH 3/3] fix: make base path configurable --- tf-module/unity-cumulus/main.tf | 2 +- tf-module/unity-cumulus/variables.tf | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tf-module/unity-cumulus/main.tf b/tf-module/unity-cumulus/main.tf index cdf304a3..1f50b125 100644 --- a/tf-module/unity-cumulus/main.tf +++ b/tf-module/unity-cumulus/main.tf @@ -175,7 +175,7 @@ resource "aws_ssm_parameter" "uds_api_1" { resource "aws_ssm_parameter" "health_check_value" { count = var.is_deploying_healthcheck ? 1 : 0 - name = "/unity/healthCheck/${var.health_check_marketplace_item}/${var.health_check_component_name}/url" + name = "${var.health_check_base_path}/${var.health_check_marketplace_item}/${var.health_check_component_name}/url" type = "String" value = "${var.uds_base_url}/${var.dapa_api_prefix}/collections" } \ No newline at end of file diff --git a/tf-module/unity-cumulus/variables.tf b/tf-module/unity-cumulus/variables.tf index 41a2c19d..cd1705ea 100644 --- a/tf-module/unity-cumulus/variables.tf +++ b/tf-module/unity-cumulus/variables.tf @@ -184,4 +184,10 @@ variable "is_deploying_healthcheck" { type = bool default = true description = "flag to specify if deploying health check" +} + +variable "health_check_base_path" { + type = string + default = "/unity/healthCheck" + description = "base path for healthcheck which should start with, but not end with `/`" } \ No newline at end of file