including environment in vars not environment_vars

This commit is contained in:
Daniel Roth 2026-02-06 16:04:57 +00:00
parent d44fdcd01c
commit f033b144c2
3 changed files with 9 additions and 6 deletions

View file

@ -33,6 +33,10 @@ def handler(event: Mapping[str, Any], context: Any) -> None:
"hello region",
os.getenv("AWS_REGION", "empty region"),
)
print(
"hello Dan:",
os.getenv("DAN", "empty dan"),
)
settings = get_settings()
print("hello db user", settings.DB_USERNAME)

View file

@ -10,9 +10,8 @@ module "lambda" {
environment = {
STAGE = var.stage
LOG_LEVEL = "info"
DB_USERNAME = var.environment_vars.DB_USERNAME
DAN = "hello"
}
# Optional extra environment variables (DB credentials)
environment_vars = var.environment_vars
}

View file

@ -18,9 +18,9 @@ variable "image_digest" {
}
variable "environment_vars" {
type = map(string)
default = {}
}
type = map(string)
default = {}
}
locals {
image_uri = "${var.ecr_repo_url}@${var.image_digest}"