Bird
0
0

A developer must update and publish Lambda functions only in the us-west-2 region. Which IAM policy best enforces least privilege?

hard📝 Application Q8 of 15
AWS - Identity and Access Management
A developer must update and publish Lambda functions only in the us-west-2 region. Which IAM policy best enforces least privilege?
A{ "Effect": "Allow", "Action": ["lambda:UpdateFunctionCode", "lambda:PublishVersion"], "Resource": "arn:aws:lambda:us-west-2:123456789012:function:*" }
B{ "Effect": "Allow", "Action": "lambda:*", "Resource": "*" }
C{ "Effect": "Allow", "Action": ["lambda:UpdateFunctionCode"], "Resource": "arn:aws:lambda:*:123456789012:function:*" }
D{ "Effect": "Allow", "Action": ["lambda:PublishVersion"], "Resource": "arn:aws:lambda:us-east-1:123456789012:function:*" }
Step-by-Step Solution
Solution:
  1. Step 1: Identify required actions

    Developer needs to update code and publish versions.
  2. Step 2: Restrict region and resource

    Resource ARN must specify us-west-2 region and correct account.
  3. Step 3: Evaluate options

    { "Effect": "Allow", "Action": ["lambda:UpdateFunctionCode", "lambda:PublishVersion"], "Resource": "arn:aws:lambda:us-west-2:123456789012:function:*" } grants only needed actions scoped to correct region and account.
  4. Final Answer:

    { "Effect": "Allow", "Action": ["lambda:UpdateFunctionCode", "lambda:PublishVersion"], "Resource": "arn:aws:lambda:us-west-2:123456789012:function:*" } best follows least privilege.
  5. Quick Check:

    Actions and resource ARN scoped correctly [OK]
Quick Trick: Scope actions and resources to region and function [OK]
Common Mistakes:
  • Granting all lambda actions on all resources
  • Using wildcard region in resource ARN
  • Granting permissions in wrong region

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes