Thank you for your reply, Brian.
At the moment what I do is the following, and I'm wondering if there's a more generic way to do it:
variable "env_var1" { default = "" }
variable "env_var2" { default = "" }
variable "env_var3" { default = "" }
resource "aws_lambda_function" "mod" {
...
environment {
variables {
LAMBDA_ENV_VAR1 = "${var.env_var1}"
LAMBDA_ENV_VAR2 = "${var.env_var2}"
LAMBDA_ENV_VAR3 = "${var.env_var3}"
}
}
}
module "my_service_slack_notification" {
source = "modules/lambda_function"
...
env_var1 = "${var.slack_encrypted_hook_url}"
env_var2 = "${var.slack_channel}"
}
So as you see I'm setting 3 environment variables when defining the module and when using it I can make use of some or all of them.
Since "variables" is a map I was wondering if I could pass it directly to the module without having to use these extra variables.
Franck