DEA-C01 · Question #146
A data engineer set up an AWS Lambda function to read an object that is stored in an Amazon S3 bucket. The object is encrypted by an AWS KMS key. The data engineer configured the Lambda function's exe
The correct answer is D. The Lambda function's execution role does not have the necessary permissions to access the. A Lambda function failing to read an AWS KMS-encrypted S3 object, despite having S3 bucket access, most likely indicates missing permissions for the Lambda execution role to use the KMS key for decryption.
Question
A data engineer set up an AWS Lambda function to read an object that is stored in an Amazon S3 bucket. The object is encrypted by an AWS KMS key. The data engineer configured the Lambda function's execution role to access the S3 bucket. However, the Lambda function encountered an error and failed to retrieve the content of the object. What is the likely cause of the error?
Options
- AThe data engineer misconfigured the permissions of the S3 bucket. The Lambda function could
- BThe Lambda function is using an outdated SDK version, which caused the read failure.
- CThe S3 bucket is located in a different AWS Region than the Region where the data engineer
- DThe Lambda function's execution role does not have the necessary permissions to access the
How the community answered
(49 responses)- A2% (1)
- B6% (3)
- C4% (2)
- D88% (43)
Why each option
A Lambda function failing to read an AWS KMS-encrypted S3 object, despite having S3 bucket access, most likely indicates missing permissions for the Lambda execution role to use the KMS key for decryption.
If the S3 bucket permissions were misconfigured, the Lambda function would typically encounter an access denied error for the S3 object itself, rather than specifically failing to retrieve its content due to encryption.
While an outdated SDK could potentially cause issues, it's a less common and less direct cause for failing to access KMS-encrypted S3 objects compared to a missing KMS permission.
Accessing S3 buckets from a different AWS Region is supported by AWS services, provided the necessary permissions are configured, and is not inherently a reason for failure without further context.
When an S3 object is encrypted using an AWS KMS key, any principal attempting to access and decrypt that object (like an AWS Lambda function) must have explicit `kms:Decrypt` permissions on the KMS key, in addition to S3 read permissions.
Concept tested: KMS permissions for S3 encrypted objects
Source: https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html
Topics
Community Discussion
No community discussion yet for this question.