Soru

Zorluk: KolayServerless Development with AWS Lambda

A team is creating several independent Python microservices using AWS Lambda. To ensure consistent logging across all services, they want to share a custom utility module and several heavy external dependencies without bundling them directly in each function's deployment zip file. What AWS Lambda feature should they use to manage and share these dependencies?

  1. AWS Lambda layersCevap
  2. B
    AWS Lambda environment variables
  3. C
    AWS Lambda execution context reuse
  4. D
    AWS Lambda handler VPC configuration

Cevap

AWS Lambda layers should be used because they allow sharing custom modules and dependencies across multiple Lambda functions, reducing individual deployment package sizes.
AWS Lambda layers allow you to package libraries, custom runtimes, and other dependencies separately from your function code. By deploying these files to a layer, multiple Lambda functions can reference and use them, which keeps the deployment zip packages small and ensures consistency across microservices.

Adım Adım Çözüm

1
Analyze the requirement to share a custom logging utility and dependencies across multiple Lambda functions without bundling them in each zip file.
Identify the need for a mechanism to externalize common dependencies.
This establishes the core technical requirement for the serverless application architecture.
2
Evaluate AWS Lambda features for dependency management.
Identify AWS Lambda layers as a feature specifically built to package, share, and promote code reuse.
Layers allow you to pull in dependencies at runtime, reducing deployment archive sizes.
3
Verify that alternative configuration options do not address code sharing.
Confirm that environment variables, execution context reuse, and VPC configurations do not distribute dependency packages.
Ensures that options related to configuration, state management, and network placement are correctly excluded.

Anahtar Kavram

AWS Lambda Layers for dependency management and code sharing
Tahmini Süre:45s
Bu soruyu puanla