exam questions

Exam AWS Certified Developer Associate All Questions

View all questions & answers for the AWS Certified Developer Associate exam

Exam AWS Certified Developer Associate topic 1 question 376 discussion

Exam question from Amazon's AWS Certified Developer Associate
Question #: 376
Topic #: 1
[All AWS Certified Developer Associate Questions]

A developer has deployed a serverless application to AWS Lambda. The developer needs to encrypt the Lambda function's environment variables by using an AWS Key Management Service (AWS KMS) customer managed key. When the developer attempts to configure the KMS key for the environment variables, an error occurs. The error message indicates that access to the KMS key was denied.

What should the developer do to resolve this error?

  • A. Set an IAM policy that allows the developer to have appropriate access to the KMS key.
  • B. Set an IAM policy that allows the Lambda function to have appropriate access to the KMS key.
  • C. Apply the AWSLambdaBasicExecutionRole managed policy to the Lambda function.
  • D. Create a trust policy for the Lambda function. In the trust policy, specify kms.amazonaws.com as a service principal.
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
pancman
Highly Voted 2 years, 3 months ago
Selected Answer: A
Answer is A. The error occurs not when Lambda tries to access KMS key, but when the DEVELOPER does.
upvoted 7 times
...
Suraj_7
Most Recent 2 years ago
Option B is the correct answer because the Lambda function is the entity that needs access to the KMS key in order to encrypt its environment variables. Therefore, the developer needs to set an IAM policy that allows the Lambda function to have appropriate access to the KMS key. When configuring an AWS KMS customer managed key for use with a Lambda function's environment variables, the key must be accessible by the Lambda function's execution role. By default, the Lambda function's execution role does not have permissions to use any KMS keys.
upvoted 1 times
...
Smartiup
2 years, 3 months ago
Selected Answer: A
The problem ocurs when the developer tries to interact with kms. Its A.
upvoted 4 times
...
JagpreetLM10
2 years, 3 months ago
Selected Answer: B
B. Set an IAM policy that allows the Lambda function to have appropriate access to the KMS key. The developer should set an IAM policy that grants the Lambda function appropriate permissions to access the KMS key. This can be done by creating an IAM role with the necessary permissions and then associating it with the Lambda function. The policy should include actions such as "kms:Encrypt" and "kms:Decrypt" permissions for the specific KMS key. Once the policy is set, the developer should re-attempt configuring the KMS key for the environment variables.
upvoted 1 times
...
JulietHsu
2 years, 3 months ago
Selected Answer: A
This is not related with lambda execution. Keyword - 'When the developer attempts to configure the KMS key for the environment variables' So, it's A.
upvoted 4 times
...
KT_Yu
2 years, 3 months ago
Selected Answer: A
ans: A KMS Exception: AccessDeniedException KMS Message https://aws.amazon.com/premiumsupport/knowledge-center/lambda-kmsaccessdeniedexception-errors/
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago