0

Common DB Configuration in AWS Lambda functions

I have 50 lambda functions which calls a Mongo DB setup in AWS EC2. Currently the ip address, port number and db name are written inside all 50 lambda functions. I need to put this configuration in a single place and all Lambda functions should be able to call it.

Please guide me what's the best way to achieve it.

Thanks.

1
  • You could use AWS SDK from the lambda to pull a file from S3 which contains your configuration values in a suitable form. Commented Jun 27, 2018 at 10:11

1 Answer 1

2

Sounds like an excellent use-case for the AWS Systems Manager Parameter Store - AWS Systems Manager:

AWS Systems Manager Parameter Store provides secure, hierarchical storage for configuration data management and secrets management. You can store data such as passwords, database strings, and license codes as parameter values. You can store values as plain text or encrypted data. You can then reference values by using the unique name that you specified when you created the parameter. Highly scalable, available, and durable, Parameter Store is backed by the AWS Cloud. Parameter Store is offered at no additional charge.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks John. I tried, it was very easy to set and pull values from it.
Be aware that currently AWS does not publish service limits for API requests to SSM Parameter Store. Also note that there is no way to request an increase to these undefined limits. You will need to discover in your own load testing if you run into any throttling exceptions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.