Encountered a few speicific use cases that I'm somewhat confused to use which:
For storing any credentials you have three AWS managed choices:
Lambda Environment Variables
These will be passed into the Lambda function directly via the Lambda Service. You can prevent others accessing the string values by controlling their permissions to KMS via IAM. This will provide the best performance out of any options (there's no additional lookup in the code runtime).
By using this option be aware of the following pitfalls:
Systems Manager Parameter Store
Using this option you would use the SDK to retrieve any key/values that you want. It can store both plain text values as well encrypted strings (the SecureString type). It provides basic functionality but if that is all you need then it will work great. It costs nothing to store the values, but the price is $0.05 per 10,000 Parameter Store API interactions
. Unlike environment variables you can use the value across multiple Lambda functions.
By using this option you would need to be aware of the following:
Secrets Manager
Using this option a lot of the management is built into the service, a secret can contain either a string or a single line JSON object. The SDK will handle the retrieval of these values but you must be aware just like SSM you will take a performance hit so you'll want to take a look at a similar solution as the parameter store. The biggest advantage to secrets manager over SSM parameter store is its integrations with other AWS services allowing features such as secret rotation.
However if you don't need the features of secrets manager you may be paying for more than you actually require, this is the most expensive option of all three.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With