AWS Certified Developer – Associate (DVA-C02) — Question 515
A developer is writing an application in AWS Lambda. To simplify testing and deployments, the developer needs the database connection string to be easily changed without modifying the Lambda code.
How can this requirement be met?
Answer options
- A. Store the connection string as a secret in AWS Secrets Manager.
- B. Store the connection string in an IAM user account.
- C. Store the connection string in AWS KMS.
- D. Store the connection string as a Lambda layer.
Correct answer: A
Explanation
Storing the database connection string in AWS Secrets Manager allows the developer to retrieve it dynamically during execution, decoupling the configuration from the AWS Lambda code. IAM user accounts and AWS KMS are not designed to store and manage connection string values directly, while Lambda layers are meant for sharing code and dependencies rather than dynamic configuration management.