AWS Certified Developer – Associate — Question 344
A company’s infrastructure team is using AWS CloudFormation to deploy common infrastructure resources such as VPCs, subnets, Amazon RDS DB cluster endpoints, and Amazon DynamoDB tables for other teams to use. The CloudFormation templates also create AWS Systems Manager Parameter Store parameters to store information about these resources for application developers. The parameters include elements such as RDS DB cluster endpoints for clusters that the templates create.
A developer creates a CloudFormation template that includes an AWS Lambda function that reads the SSM parameter value to access RDS DB cluster endpoints. The Lambda function has reserved concurrency configured to match the value of the Parameter Store maximum throughput (transactions per second) quota for the account and the AWS Region that hosts the account.
The developer wants to prepare for a potential load increase. The developer expects the Lambda function’s concurrent invocation rate to be two times more than the Parameter Store maximum throughput quota value.
Which solution will prepare for the load increase MOST cost-effectively?
Answer options
- A. Move the code that is reading the SSM parameter value outside the Lambda function handler. Store the RDS DB cluster endpoint value in a global variable. Use the endpoint value inside the Lambda function handler.
- B. Move the code that is reading the SSM parameter value outside the Lambda function handler. Store the RDS DB cluster endpoint value in an environment variable. Use the endpoint value inside the Lambda function handler.
- C. Request a service quota increase for the Systems Manager GetParameter rate quota value to match the Lambda function's concurrency.
- D. Add an SSM parameter to the CloudFormation template that resolves the RDS DB cluster endpoint value at deployment time by using the ssm dynamic reference. Update the Lambda function resource in CloudFormation to create an environment variable that references the newly created SSM parameter.
Correct answer: D
Explanation
Option D is the most cost-effective solution because using CloudFormation dynamic references ('resolve:ssm') resolves the parameter value at the time of stack deployment. This passes the endpoint directly to the Lambda function as an environment variable, completely removing the need for the Lambda function to call the Systems Manager Parameter Store API at runtime. Options A and B still require API calls during cold starts, which can fail under high concurrency, while Option C incurs additional costs for increasing Parameter Store throughput limits.