Database configuration as environment variables

The test bed code has the database configuration parameters hardcoded into the code. What happens when the credentials have to be changed as part of regular rotation, or due to unforeseen reasons the URL of the database changes?

One way is to edit and deploy a new copy of the function each time, but that becomes cumbersome and unscalable. It also quickly becomes unwieldy and difficult to manage as the number of such configuration parameters grows.

Another way to solve this problem is to inject the parameters as an environment configuration.

Get Hands-On Serverless Applications with Kotlin now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.