Secrets Manager API vs Lambda Extension
A performance comparison
getSecretWithSecretsManagerAPI
: it retrieves the secret using the Secrets Manager API (sdk v3).getSecretWithLambdaExtension
: it retrieves the secret using the Secrets Lambda Extension.
- Use
nodejs20.x
runtime - Use
arm64
architecture - Are deployed in
eu-west-1
region
After running the state machine once for each Lambda function, I used the tool's UI to compare the results.

The test confirms the expectations: the lambda that retrieves the secret using Lambda Extension is always more performant and cheaper than the lambda that retrieves the secret using Secrets Manager API.
Memory Allocation | getSecretWithSecretsManagerAPI | getSecretWithLambdaExtension |
---|---|---|
128 MB | 46ms | 23ms |
256 MB | 25ms | 16ms |
512 MB | 24ms | 5ms |
1024 MB | 24ms | 5ms |
1536 MB | 25ms | 5ms |
3008 MB | 24ms | 5ms |
Memory Allocation | getSecretWithSecretsManagerAPI | getSecretWithLambdaExtension |
---|---|---|
128 MB | 0.000000078$ | 0.000000041$ |
256 MB | 0.000000085$ | 0.000000054$ |
512 MB | 0.000000163$ | 0.000000034$ |
1024 MB | 0.00000033$ | 0.000000068$ |
1536 MB | 0.00000051$ | 0.000000102$ |
3008 MB | 0.000001$ | 0.00000024$ |