Platforms

Envlet on AWS

Lambda, ECS, and EC2 all take one environment variable. ENVLET_TOKEN replaces every other secret you were copying into task definitions.

Set the token
aws lambda update-function-configuration \
  --function-name api \
  --environment "Variables={ENVLET_TOKEN=envlet_...}"
Inject on cold start
from envlet import inject

inject()

def handler(event, context):
    ...

Set up

  1. 01

    Create a token

    Create an identity for AWS and a token for the environment it deploys.

  2. 02

    Set one secret

    Set ENVLET_TOKEN in the Lambda configuration, the ECS task definition, or the instance user data. Store that one value in Secrets Manager if your policy requires it.

  3. 03

    Start through Envlet

    Inject at module load so a cold start fetches once and warm invocations reuse the environment.

Questions

Will my app start if Envlet is down?
No, and that is the point. It retries for a few seconds, then fails so you notice, instead of starting with half an environment.
Do I still need AWS's own secret store?
Only for ENVLET_TOKEN. Everything else lives in Envlet, so you rotate in one place.

Stop pasting .env files.

One command. The right values for whoever runs it.