Bird
0
0

You want to share a custom logging library across multiple Lambda functions in different AWS accounts. What is the best approach using Lambda layers?

hard📝 Application Q8 of 15
AWS - Lambda
You want to share a custom logging library across multiple Lambda functions in different AWS accounts. What is the best approach using Lambda layers?
APublish the layer as a public layer and reference its ARN in each account
BCopy the layer code into each function's deployment package
CCreate the layer in one account and share the function code only
DUse environment variables to pass the library code
Step-by-Step Solution
Solution:
  1. Step 1: Understand cross-account sharing

    Lambda layers can be shared publicly or with specific accounts via ARNs.
  2. Step 2: Choose best sharing method

    Publishing the layer publicly allows all accounts to reference it easily without code duplication.
  3. Final Answer:

    Publish the layer as a public layer and reference its ARN in each account -> Option A
  4. Quick Check:

    Cross-account sharing = public layer ARN [OK]
Quick Trick: Publish layers publicly to share across accounts easily [OK]
Common Mistakes:
MISTAKES
  • Copying code into each function instead of using layers
  • Sharing only function code without layers
  • Trying to pass code via environment variables

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes