spring-media / terraform-aws-lambda

A Terraform module to create AWS Lambda ressources.
https://registry.terraform.io/modules/spring-media/lambda/aws
MIT License
66 stars 44 forks source link

enhance and clarify secrets management #59

Open moritzzimmer opened 4 years ago

moritzzimmer commented 4 years ago

There are different possibilities and recommendations how to manage and access secrets (e.g. database passwords) inside Lambda functions (see e.g here and here).

Currently this module supports reading (optionally encrypted) parameters from AWS Systems Manager Parameter Store at runtime by creating IAM policies allowing access to and decryption of parameters by setting ssm_parameter_names and kms_key_arn. This is the recommended way for Lambda functions if the Parameter Store API limits are no concern in case of horizontal scaling.

Unfortunately kms_key_arn conflicts with the parameter specified in the Terraform Lambda ressource to specify a key that is used to encrypt environment variables.

Proposal:

moritzzimmer commented 4 years ago

this is fixed with https://github.com/moritzzimmer/terraform-aws-lambda/releases/tag/v5.4.0