This commit is contained in:
2025-03-28 11:51:16 -03:00
parent 88c2585d2a
commit ac61f8aba0
9 changed files with 31 additions and 17 deletions

View File

@@ -8,16 +8,14 @@ COURSE_TABLE: str = os.getenv('COURSE_TABLE') # type: ignore
KONVIVA_API_URL: str = os.getenv('KONVIVA_API_URL') # type: ignore
KONVIVA_SECRET_KEY: str = os.getenv('KONVIVA_SECRET_KEY') # type: ignore
match os.getenv('AWS_SAM_LOCAL'), os.getenv('ELASTIC_HOSTS'):
case str() as AWS_SAM_LOCAL, _ if (
AWS_SAM_LOCAL
): # Only when running `sam local start-api`
match os.getenv('AWS_SAM_LOCAL'), os.getenv('PYTEST_VERSION'):
case str() as SAM_LOCAL, _ if SAM_LOCAL: # Only when running `sam local start-api`
ELASTIC_CONN = {
'hosts': 'http://host.docker.internal:9200',
}
case _, str() as ELASTIC_HOSTS if ELASTIC_HOSTS:
case _, str() as PYTEST if PYTEST: # Only when running `pytest`
ELASTIC_CONN = {
'hosts': ELASTIC_HOSTS,
'hosts': 'http://127.0.0.1:9200',
}
case _:
ELASTIC_CLOUD_ID = os.getenv('ELASTIC_CLOUD_ID')