Topic 1 Question 65
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?
Create a Lambda environment variable to store the table name. Use the standard method for the programming language to retrieve the variable.
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.
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.
Create a global variable that is outside the handler in the Lambda function to store the table name.
ユーザの投票
コメント(3)
- 正解だと思う選択肢: A
You need to use environment variables
👍 4Dun62023/03/23 - 正解だと思う選択肢: A👍 3Untamables2023/03/26
- 正解だと思う選択肢: A
Explanation: Using Lambda environment variables allows you to store configuration information separate from your code, which makes it easy to update the table name without changing the Lambda function code. AWS Lambda provides built-in support for environment variables, making it the most efficient solution.
👍 3gpt_test2023/04/03
シャッフルモード