ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 73 - DVA-C02 discussion

Report
Export

A developer is building a new application on AWS. The application uses an AWS Lambda function that retrieves information from an Amazon DynamoDB table. The developer hard coded the DynamoDB table name into the Lambda function code. The table name might change over time. The developer does not want to modify the Lambda code if the table name changes.

Which solution will meet these requirements MOST efficiently?

A.
Create a Lambda environment variable to store the table name. Use the standard method for the programming language to retrieve the variable.
Answers
A.
Create a Lambda environment variable to store the table name. Use the standard method for the programming language to retrieve the variable.
B.
Store the table name in a file. Store the file in the /tmp folder. Use the SDK for the programming language to retrieve the table name.
Answers
B.
Store the table name in a file. Store the file in the /tmp folder. Use the SDK for the programming language to retrieve the table name.
C.
Create a file to store the table name. Zip the file and upload the file to the Lambda layer. Use the SDK for the programming language to retrieve the table name.
Answers
C.
Create a file to store the table name. Zip the file and upload the file to the Lambda layer. Use the SDK for the programming language to retrieve the table name.
D.
Create a global variable that is outside the handler in the Lambda function to store the table name.
Answers
D.
Create a global variable that is outside the handler in the Lambda function to store the table name.
Suggested answer: A

Explanation:

The solution that will meet the requirements most efficiently is to create a Lambda environment variable to store the table name. Use the standard method for the programming language to retrieve the variable. This way, the developer can avoid hard-coding the table name in the Lambda function code and easily change the table name by updating the environment variable. The other options either involve storing the table name in a file, which is less efficient and secure than using an environment variable, or creating a global variable, which is not recommended as it can cause concurrency issues.

Reference: Using AWS Lambda environment variables

asked 16/09/2024
GIORGOS KELAIDIS
32 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first