The problem description: I have a python code in Bitbucket which is deployed to the AWS to be executed as a lambda function. The setup is based on this guide: https://bitbucket.org/blog/aws-lambda-deployments-using-bitbucket-pipelines-and-pipes
In the python code, I plan to use credentials (e.g. for the database access), and the source code is obviously a wrong place to store them.
What is a recommended storage place and way of passing credentials to the lambda function?
Should it be Bitbucket's repository variables? If yes, then how do I pass them to the lambda function's code?
Or should it be AWS Lambda environment variables? Same question then.
You could store them in AWS SSM Parameter Store and fetch them at runtime.
That way you can manage who has access to it. Putting it in env variables will display the secret in plain text to anyone that can see it.
The way I structure is this: