Which combination of steps will ensure that only the Lambda function's execution role can access a Secrets Manager secret encrypted with KMS, following least-privilege principles? (Choose two.)
Choose an answer
Tap an option to check your answer.
Correct answer: Create a customer-managed KMS key that trusts Secrets Manager and grants the Lambda function's execution role decrypt permission, and update Secrets Manager to use this CMK., Ensure the Lambda function’s execution role has KMS permissions scoped to the specific key resource (including decrypt), and configure the key so it can encrypt the Secrets Manager secret..
Why this is the answer
To ensure least privilege, you must use a customer-managed key (CMK) for Secrets Manager. The default AWS-managed key for Secrets Manager is shared across accounts and cannot be restricted to a specific Lambda role. Creating a CMK allows you to define a key policy that explicitly grants kms:Decrypt permission to only the Lambda function's execution role. This CMK must also trust Secrets Manager (via its service principal) to allow Secrets Manager to use the key. The Lambda function's execution role then needs an IAM policy granting kms:Decrypt on this specific CMK. Granting decrypt to the account root principal is overly permissive and violates least privilege. Removing all KMS permissions would prevent the Lambda function from decrypting the secret.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed