Skill 2.3.2
Encrypt environment variables that contain sensitive data
Key Concepts
Lambda always encrypts environment variables at rest with a KMS key, AWS managed by default or a customer managed key you choose. For stronger protection you can enable encryption helpers, which encrypt values client-side in the console so they appear as ciphertext in the configuration; your code must then call kms:Decrypt at runtime, and the execution role needs that permission.
The preferred approach is often not to store the secret in an environment variable at all, but to store its name there and fetch the value from Secrets Manager or Parameter Store at startup, caching it, for example with the Parameters and Secrets Lambda extension.