sondehub-infra/lambda/config_handler
2023-10-23 00:11:51 +11:00
..
__init__.py Dont error recovery ingestion on single error 2023-10-23 00:11:51 +11:00
__main__.py Move lambda functions to secrets manager (#126) 2023-10-22 14:40:16 +11:00
README.md Move lambda functions to secrets manager (#126) 2023-10-22 14:40:16 +11:00

Helper class for getting config and secrets within SondeHub

Example

import config_handler

mqtt_password = config_handler.get("MQTT", "PASSWORD")

Logic

  1. Checks environment variable for "{TOPIC}_{PARAMETER}" if it exists return that value
  2. If that doesn't exist then we perform a SecretsManager.Client.get_secret_value(SecretId={TOPIC})
  3. We then json.loads() this value and return the respective value.