- Infisical SDKs
- AWS Secrets Manager integration
- AWS Systems Manager Parameter Store integration
- AWS CLI
Choose your sync strategy
1. Fetch secrets at runtime with Infisical SDKs
If you control the Lambda code, the simplest method is to fetch secrets directly from Infisical using one of our SDKs.You can read more about the Infisical SDKs here.
2. Push via secret sync
Configure a secret sync from your Infisical project, and Infisical will keep your Secrets Manager or Parameter Store values up to date. Your Lambda function can then reference those secrets directly.Learn more about the AWS Secrets Manager integration and the AWS Parameter Store integration.
3. Push environment variables directly using the AWS CLI
For straightforward workflows or quick rotations, you can push Infisical secrets directly into Lambda environment variables using the AWS CLI.Prerequisites
- AWS CLI v2 installed and authenticated
jqinstalled locally- An IAM principal with
lambda:UpdateFunctionConfiguration - Infisical CLI (
infisical) configured
IAM permissions
Attach a policy like the one below to the IAM user or role responsible for updating Lambda configuration:Replacing Lambda environment variables using the AWS CLI overwrites the entire
Variables object. Make sure to export your current values so you can import them
into Infisical.Push secrets to Lambda
Use the Infisical CLI to export secrets as JSON and pass them to the AWS CLI. The example below targets a project by ID, but you can also use the--project and --env flags.
Learn more about infisical export here.
Environment.Variables block will be returned.
Verify the values in the Lambda console or by invoking the function.
We recommend using automatic secret syncs to AWS Secrets Manager or AWS
Parameter Store to keep your secrets continuously in sync and avoid manually
updating the Lambda configuration.