Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions lambda_function/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ça faudra revoir aussi. Si on peut limiter les frais...

"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/ApiGeodeSolutions/4a4814e5912d42aa/70716e78eabafa1f",
"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/ApiGeodeSolutions/4a4814e5912d42aa/70716e78eabafa1f",
"PING_ROUTE": f"/{ID}/opengeodeweb_back/ping",
"ORIGINS": "https://next.vease.geode-solutions.com",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah on peut faire ça ? Je ne savais pas

"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:
Expand All @@ -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"]
Expand Down