
Ultimate access to all questions.
Deep dive into the quiz with AI chat providers.
We prepare a focused prompt with your quiz and certificate details so each AI can offer a more tailored, in-depth explanation.
A company has an application workflow that uses an AWS Lambda function to download and decrypt files from Amazon S3. These files are encrypted using AWS Key Management Service (AWS KMS) keys. A solutions architect needs to design a solution that will ensure the required permissions are set correctly.
Which combination of actions accomplish this? (Choose two.)
A
Attach the kms:decrypt permission to the Lambda function's resource policy
B
Grant the decrypt permission for the Lambda IAM role in the KMS key's policy
C
Grant the decrypt permission for the Lambda resource policy in the KMS key's policy.
D
Create a new IAM policy with the kms:decrypt permission and attach the policy to the Lambda function.
E
Create a new IAM role with the kms:decrypt permission and attach the execution role to the Lambda function.
Explanation:
When a Lambda function needs to decrypt files encrypted with AWS KMS keys, the following permissions are required:
KMS Key Policy: The KMS key's policy must grant the kms:Decrypt permission to the Lambda function's IAM role. This is essential because KMS keys have their own resource-based policies that control who can use them.
IAM Role/Permissions: The Lambda function's execution role must have the kms:Decrypt permission in its IAM policy. This allows the Lambda function to make the API call to KMS.
Why B and D are correct:
Why other options are incorrect:
Best Practice Approach:
kms:Decrypt permission for the specific KMS keykms:Decrypt permission to the Lambda function's IAM roleThis two-way permission model ensures both the caller (Lambda) has permission to make the API call and the resource (KMS key) allows the caller to use it.