AWS - Identity and Access ManagementTo grant a Lambda function the minimum necessary permissions to read from a DynamoDB table, which IAM feature should you use?AAssign the Lambda function the AdministratorAccess policyBCreate an IAM user with read access and embed its credentials in the Lambda codeCUse a resource-based policy on the DynamoDB table to allow Lambda accessDAttach an IAM role with a policy granting read permissions to the Lambda functionCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand Lambda permissionsLambda functions assume IAM roles to get permissions.Step 2: Apply least privilege principleAttach a role with only necessary read permissions.Final Answer:Attach an IAM role with a policy granting read permissions to the Lambda function -> Option DQuick Check:Use IAM roles for Lambda permissions [OK]Quick Trick: Use IAM roles, not users, for Lambda permissions [OK]Common Mistakes:MISTAKESEmbedding IAM user credentials in codeUsing overly permissive policies like AdministratorAccessRelying solely on resource-based policies
Master "Identity and Access Management" in AWS9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More AWS Quizzes AWS CLI - Installing AWS CLI - Quiz 5medium AWS CLI - CLI output formats (json, table, text) - Quiz 9hard EC2 Fundamentals - Elastic IP addresses - Quiz 8hard Identity and Access Management - IAM roles concept - Quiz 4medium Identity and Access Management - IAM policies (JSON structure) - Quiz 3easy Identity and Access Management - IAM policies (JSON structure) - Quiz 12easy Identity and Access Management - Assuming roles for temporary access - Quiz 4medium S3 Fundamentals - Creating S3 buckets - Quiz 14medium Security Groups and Network ACLs - Security group as virtual firewall - Quiz 6medium VPC Fundamentals - Creating a custom VPC - Quiz 6medium