From d55f989f213faae6e49a866baac1489f32112c5d Mon Sep 17 00:00:00 2001 From: JulienChampagnol Date: Mon, 17 Feb 2025 14:24:52 +0100 Subject: [PATCH 1/3] feat(config): vease config --- lambda_function/config.py | 72 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/lambda_function/config.py b/lambda_function/config.py index 13ca90e..d054c91 100644 --- a/lambda_function/config.py +++ b/lambda_function/config.py @@ -106,6 +106,65 @@ def __init__(self, REQUEST_ORIGIN: str, REQUEST_PATH: str, ID: str = None): "VPC_ID": "vpc-0e58c4d6976fb2aac", }, }, + "VEASE": { + "MASTER": { + "API_URL": "https://api.geode-solutions.com", + "ASSIGN_PUBLIC_IP": "ENABLED", + "CLUSTER_NAME": "Vease-Master", + "ENVIRONMENT_VARIABLES": { + "name": "geode", + "environment": [{"name": "ID", "value": ID}], + }, + "HEALTHCHECK_PORT": 443, + "HEALTHCHECK_ROUTE": f"/{ID}/geode/healthcheck", + "LISTENER_ARN": "arn:aws:elasticloadbalancing:eu-west-3:622060531233:listener/app/Api2GeodeSolutions/fd4af85f9ffc5a54/b559795c939115f4", + "PING_ROUTE": f"/{ID}/opengeodeweb_back/ping", + "ORIGINS": "https://vease.geode-solutions.com", + "SECONDS_BETWEEN_TRIES": 0.25, + "SECURITY_GROUP": "sg-01bcf5f64e3427fd3", + "SUBNET_ID": "subnet-0882d674b17515f6a", + "TASK_DEF_NAME": "Vease-Master", + "VPC_ID": "vpc-0e58c4d6976fb2aac", + }, + "NEXT": { + "API_URL": "https://api.geode-solutions.com", + "ASSIGN_PUBLIC_IP": "ENABLED", + "CLUSTER_NAME": "Vease-Next", + "ENVIRONMENT_VARIABLES": { + "name": "geode", + "environment": [{"name": "ID", "value": ID}], + }, + "HEALTHCHECK_PORT": 443, + "HEALTHCHECK_ROUTE": f"/{ID}/geode/healthcheck", + "LISTENER_ARN": "arn:aws:elasticloadbalancing:eu-west-3:622060531233:listener/app/Api2GeodeSolutions/fd4af85f9ffc5a54/b559795c939115f4", + "PING_ROUTE": f"/{ID}/opengeodeweb_back/ping", + "ORIGINS": "https://vease-next.geode-solutions.com", + "SECONDS_BETWEEN_TRIES": 0.25, + "SECURITY_GROUP": "sg-07787694c5fdf2429", + "SUBNET_ID": "subnet-0882d674b17515f6a", + "TASK_DEF_NAME": "Vease-Next", + "VPC_ID": "vpc-0e58c4d6976fb2aac", + }, + "TEST": { + "API_URL": "https://api.geode-solutions.com", + "ASSIGN_PUBLIC_IP": "ENABLED", + "CLUSTER_NAME": "Vease-Test", + "ENVIRONMENT_VARIABLES": { + "name": "geode", + "environment": [{"name": "ID", "value": ID}], + }, + "HEALTHCHECK_PORT": 443, + "HEALTHCHECK_ROUTE": f"/{ID}/geode/healthcheck", + "LISTENER_ARN": "arn:aws:elasticloadbalancing:eu-west-3:622060531233:listener/app/ApiGeodeSolutions/4a4814e5912d42aa/70716e78eabafa1f", + "ORIGINS": "TO_COMPLETE", + "PING_ROUTE": f"/{ID}/geode/opengeodeweb_back/ping", + "SECONDS_BETWEEN_TRIES": 0.25, + "SECURITY_GROUP": "sg-0352ea112857ae7b9", + "SUBNET_ID": "subnet-0882d674b17515f6a", + "TASK_DEF_NAME": "TO_COMPLETE", + "VPC_ID": "vpc-0e58c4d6976fb2aac", + }, + }, } if "/website/" in REQUEST_PATH: @@ -129,6 +188,19 @@ def __init__(self, REQUEST_ORIGIN: str, REQUEST_PATH: str, ID: str = None): CONFIG_ENV = "MASTER" elif REQUEST_ORIGIN == CONFIG_DICT[CONFIG_TYPE]["NEXT"]["ORIGINS"]: CONFIG_ENV = "NEXT" + elif "/vease/" in REQUEST_PATH: + CONFIG_TYPE = "VEASE" + if REQUEST_ORIGIN == "": + CONFIG_TYPE = "NEXT" + elif REQUEST_ORIGIN == CONFIG_DICT[CONFIG_TYPE]["MASTER"]["ORIGINS"]: + CONFIG_ENV = "MASTER" + elif REQUEST_ORIGIN == CONFIG_DICT[CONFIG_TYPE]["NEXT"]["ORIGINS"]: + CONFIG_ENV = "NEXT" + elif "--geode-solutions.netlify.app" in REQUEST_ORIGIN: + CONFIG_ENV = "TEST" + task = REQUEST_ORIGIN[8:].split("--geode-solutions.netlify.app")[0] + CONFIG_DICT[CONFIG_TYPE][CONFIG_ENV]["ORIGINS"] = REQUEST_ORIGIN + CONFIG_DICT[CONFIG_TYPE][CONFIG_ENV]["TASK_DEF_NAME"] = task self.API_URL = CONFIG_DICT[CONFIG_TYPE][CONFIG_ENV]["API_URL"] self.ASSIGN_PUBLIC_IP = CONFIG_DICT[CONFIG_TYPE][CONFIG_ENV]["ASSIGN_PUBLIC_IP"] From 675456fbf515e56aec7c33622052187720a8ca7d Mon Sep 17 00:00:00 2001 From: JulienChampagnol Date: Mon, 17 Feb 2025 15:26:23 +0100 Subject: [PATCH 2/3] fix(domain): next.vease.geode-solutions.com --- lambda_function/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lambda_function/config.py b/lambda_function/config.py index d054c91..58b24cc 100644 --- a/lambda_function/config.py +++ b/lambda_function/config.py @@ -138,7 +138,7 @@ def __init__(self, REQUEST_ORIGIN: str, REQUEST_PATH: str, ID: str = None): "HEALTHCHECK_ROUTE": f"/{ID}/geode/healthcheck", "LISTENER_ARN": "arn:aws:elasticloadbalancing:eu-west-3:622060531233:listener/app/Api2GeodeSolutions/fd4af85f9ffc5a54/b559795c939115f4", "PING_ROUTE": f"/{ID}/opengeodeweb_back/ping", - "ORIGINS": "https://vease-next.geode-solutions.com", + "ORIGINS": "https://next.vease.geode-solutions.com", "SECONDS_BETWEEN_TRIES": 0.25, "SECURITY_GROUP": "sg-07787694c5fdf2429", "SUBNET_ID": "subnet-0882d674b17515f6a", From 135cc547e2d7ce2e7260891ba2e8c10ad5fd916d Mon Sep 17 00:00:00 2001 From: JulienChampagnol Date: Mon, 17 Feb 2025 15:30:32 +0100 Subject: [PATCH 3/3] LISTENER_ARN --- lambda_function/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lambda_function/config.py b/lambda_function/config.py index 58b24cc..cfcd029 100644 --- a/lambda_function/config.py +++ b/lambda_function/config.py @@ -117,7 +117,7 @@ def __init__(self, REQUEST_ORIGIN: str, REQUEST_PATH: str, ID: str = None): }, "HEALTHCHECK_PORT": 443, "HEALTHCHECK_ROUTE": f"/{ID}/geode/healthcheck", - "LISTENER_ARN": "arn:aws:elasticloadbalancing:eu-west-3:622060531233:listener/app/Api2GeodeSolutions/fd4af85f9ffc5a54/b559795c939115f4", + "LISTENER_ARN": "arn:aws:elasticloadbalancing:eu-west-3:622060531233:listener/app/ApiGeodeSolutions/4a4814e5912d42aa/70716e78eabafa1f", "PING_ROUTE": f"/{ID}/opengeodeweb_back/ping", "ORIGINS": "https://vease.geode-solutions.com", "SECONDS_BETWEEN_TRIES": 0.25, @@ -136,7 +136,7 @@ def __init__(self, REQUEST_ORIGIN: str, REQUEST_PATH: str, ID: str = None): }, "HEALTHCHECK_PORT": 443, "HEALTHCHECK_ROUTE": f"/{ID}/geode/healthcheck", - "LISTENER_ARN": "arn:aws:elasticloadbalancing:eu-west-3:622060531233:listener/app/Api2GeodeSolutions/fd4af85f9ffc5a54/b559795c939115f4", + "LISTENER_ARN": "arn:aws:elasticloadbalancing:eu-west-3:622060531233:listener/app/ApiGeodeSolutions/4a4814e5912d42aa/70716e78eabafa1f", "PING_ROUTE": f"/{ID}/opengeodeweb_back/ping", "ORIGINS": "https://next.vease.geode-solutions.com", "SECONDS_BETWEEN_TRIES": 0.25,