exam questions

Exam AWS Certified Developer Associate All Questions

View all questions & answers for the AWS Certified Developer Associate exam

Exam AWS Certified Developer Associate topic 1 question 379 discussion

Exam question from Amazon's AWS Certified Developer Associate
Question #: 379
Topic #: 1
[All AWS Certified Developer Associate Questions]

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?

  • 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.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
JagpreetLM10
Highly Voted 2 years, 3 months ago
Selected Answer: 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. This solution will prepare for the load increase most cost-effectively because it eliminates the need to make a request for a service quota increase and it ensures that the SSM parameter is resolved at deployment time, reducing the number of SSM calls made by the Lambda function.
upvoted 7 times
...
pranay_2406
Most Recent 1 year, 11 months ago
Selected Answer: B
It's B By storing the RDS DB cluster endpoint value in an environment variable, you can avoid making repeated calls to the Systems Manager Parameter Store (SSM) within the Lambda function handler. Instead, the Lambda function can retrieve the value once during initialization and store it in memory, reducing the overhead of additional API calls. Here's how the solution would work: Retrieve the RDS DB cluster endpoint value from the SSM Parameter Store outside the Lambda function handler, preferably during the initialization phase of the Lambda function. Store the retrieved value in an environment variable. Access the environment variable within the Lambda function handler to use the RDS DB cluster endpoint value. By following this approach, the Lambda function can reuse the stored value from the environment variable for subsequent invocations, eliminating the need to make additional API calls to the SSM Parameter Store.
upvoted 1 times
pranay_2406
1 year, 11 months ago
Option A is not recommended because storing the RDS DB cluster endpoint value in a global variable within the Lambda function handler may not persist across different invocations, leading to unnecessary API calls to the SSM Parameter Store. Option C is not necessary in this scenario. Requesting a service quota increase for the Systems Manager GetParameter rate quota is not required since the Lambda function's concurrency can be managed independently. Option D introduces unnecessary complexity. While using an SSM parameter in the CloudFormation template and referencing it in the Lambda function's environment variable is possible, it adds extra steps and dependencies, which are not needed when a simple environment variable can fulfill the requirement.
upvoted 1 times
...
...
sdafadsfa
2 years, 1 month ago
Selected Answer: B
this is the answer
upvoted 1 times
...
tieyua
2 years, 2 months ago
Selected Answer: B
Tentatively changing my mind to B. The question seems assuming buggy code to begin with, and worrying about lambda making too many calls to parameter store. So it calls SSM store outside handler, set env variables, and read it from inside handler. Although this has a serious flaw, as it implies trying to initialize RDS using the endpoint value, from inside the handler. For the alternatives, B: variables set outside handler is global in scope, but not sure if we can call it global variables; D: seems lock down db info at deployment time, that seems defeat the purpose of SSM
upvoted 1 times
tieyua
2 years, 2 months ago
Sorry, I mean "For the alternatives, A: ..."
upvoted 1 times
...
...
pancman
2 years, 3 months ago
Selected Answer: A
A makes sense. After retrieving the endpoint value from SSM, we need to store it in a global variable. Lambda environment variables are not suitable in this case, as we wouldn't need to get it from SSM if we wanted to use the environment variables anyway.
upvoted 2 times
tieyua
2 years, 2 months ago
Can you call a variable declared outside handler "global variable"? I can't find any reference to that.
upvoted 1 times
...
...
Drey
2 years, 3 months ago
Selected Answer: D
D is the most cost-effective and scalable solution to resolve the issue, as it involves resolving the RDS DB cluster endpoint value at deployment time and referencing it in an environment variable in the Lambda function, which reduces the number of calls to the Systems Manager Parameter Store.
upvoted 2 times
tieyua
2 years, 2 months ago
What if you need to switch db endpoint later on? Isn't that the point of having parameter store to begin with?
upvoted 2 times
...
...
tieyua
2 years, 3 months ago
Selected Answer: D
Has to agree with D. The whole setup has nothing to do with SSM, throughput, quota, reserved concurrency ... It's a simple nested stack, no developer is dummy enough to talk about potential load. Can't guarantee that's the intention of the examiner though. Good luck
upvoted 2 times
tieyua
2 years, 2 months ago
I might have changed my mind, tempting B
upvoted 1 times
...
...
michele_scar
2 years, 3 months ago
Selected Answer: A
Global var is more efficient how is explained in the doc. https://docs.aws.amazon.com/lambda/latest/operatorguide/global-scope.html Given the data from SSM are not "confidential" or "private" should stay outside the handler: connection db string and aws-region.
upvoted 2 times
...
Phinx
2 years, 3 months ago
Selected Answer: B
I think this is B
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago