Bird
0
0

Which of the following is the correct way to add a Lambda layer to a function using AWS CLI?

easy📝 Configuration Q12 of 15
AWS - Lambda
Which of the following is the correct way to add a Lambda layer to a function using AWS CLI?
Aaws lambda update-function-configuration --function-name MyFunction --layers arn:aws:lambda:region:account-id:layer:MyLayer:1
Baws lambda create-layer-version --function-name MyFunction --layer-name MyLayer
Caws lambda add-layer-version --function-name MyFunction --layer-name MyLayer
Daws lambda attach-layer --function-name MyFunction --layer-name MyLayer
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct CLI command to add layer

    The correct command to add a layer to a Lambda function is update-function-configuration with the --layers parameter specifying the layer ARN.
  2. Step 2: Review options for syntax correctness

    aws lambda update-function-configuration --function-name MyFunction --layers arn:aws:lambda:region:account-id:layer:MyLayer:1 uses the correct command and syntax. Options A, B, and D use invalid or non-existent commands.
  3. Final Answer:

    aws lambda update-function-configuration --function-name MyFunction --layers arn:aws:lambda:region:account-id:layer:MyLayer:1 -> Option A
  4. Quick Check:

    Update function config with layers ARN = aws lambda update-function-configuration --function-name MyFunction --layers arn:aws:lambda:region:account-id:layer:MyLayer:1 [OK]
Quick Trick: Use update-function-configuration with --layers ARN [OK]
Common Mistakes:
MISTAKES
  • Using create-layer-version to attach layers
  • Trying non-existent commands like add-layer-version
  • Not specifying full ARN for the layer

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes