A solutions architect is configuring a new AWS Lambda function that must read data from an Amazon DynamoDB table. According to AWS security best practices, how should the solutions architect grant the Lambda function the necessary permissions to access the table?
- Create an IAM execution role with a permissions policy that allows read access to the DynamoDB table, and associate this role with the Lambda function.Answer
- BConfigure the Lambda function to execute using the AWS account root user credentials to ensure that database access is never blocked by permission changes.
- CCreate an IAM user with DynamoDB read permissions, generate long-term access keys, and store them as a plain text string in Systems Manager Parameter Store for the Lambda function to retrieve.
- DCreate individual IAM users for each corporate identity, and configure the Lambda function to authenticate against the database using these federated user credentials.
Answer
Create an IAM execution role with a permissions policy that allows read access to the DynamoDB table, and associate this role with the Lambda function.
The correct answer is correct because configuring an IAM execution role and attaching it to the Lambda function allows the function to securely assume the role at runtime. This provides the function with temporary credentials via AWS STS and follows the principle of least privilege without managing static credentials.
Step-by-Step Solution
Key Concept
AWS Lambda execution roles permit service-to-service authorization using temporary credentials rather than long-term access keys.