AWS serverless local development

AWS SAM CLI

The first-party AWS CLI for building, testing, and invoking SAM-defined serverless applications locally.

Editorial verdict

Choose AWS SAM CLI for focused first-party testing of SAM-defined serverless applications; use broader emulation only when additional AWS APIs are genuinely required.12

Best for

  • SAM template validation and local builds
  • Local Lambda invocation and API event testing
  • AWS serverless teams wanting a first-party CLI
12

Not ideal for

  • Broad AWS service emulation
  • Production IAM, quota, networking, or regional validation
  • Non-SAM application architectures
12
Main trade-off

First-party alignment and narrow scope reduce abstraction while coverage remains limited to documented serverless local workflows.12

Product boundary

Whether first-party local testing for AWS serverless templates is sufficient, or broader service emulation is required.

SAM CLI local commands emulate bounded Lambda and API workflows through local containers; they do not reproduce all AWS services or production behavior.12

For: AWS serverless teams using SAM templates and Lambda-centered application flows

  • The application depends on AWS services outside SAM local coverage.
  • The production test requirement includes IAM, regions, quotas, or managed networking.
  • The project does not use SAM templates.

Why teams consider AWS SAM CLI

  • First-party toolingAWS maintains the CLI for SAM application workflows.12
  • Template alignmentLocal commands operate against SAM-defined resources.12
  • Containerized invocationSupported Lambda runtimes can be invoked through local containers.12

Pricing

AWS SAM CLI is open-source software without a separate CLI fee; local Docker resources, CI, and any real AWS resources or services are separate costs.12

Local serverless workflow

Open-source CLI plus local runtime

Model developer or CI compute, container images, build cache, and any AWS resources used outside local emulation.12

Software boundary
Open-source CLI12
Cloud boundary
Actual AWS resources and services are billed separately12
Pricing checked View official pricing

AWS SAM CLI vs alternatives

LocalStack

Choose when
Local tests need a broader set of AWS APIs.
Avoid when
SAM-local coverage is sufficient.
Compared with AWS SAM CLI
Broader emulation adds third-party coverage and licensing boundaries.45

Firebase Local Emulator Suite

Choose when
The product uses Firebase services rather than AWS serverless.
Avoid when
SAM and AWS are the target.
Compared with AWS SAM CLI
Firebase-specific fidelity replaces AWS alignment.67

Supabase CLI

Choose when
The local dependency is the Supabase stack.
Avoid when
AWS Lambda and SAM templates define the application.
Compared with AWS SAM CLI
A database/auth/storage local stack replaces serverless-template tooling.89

Resources and sources

Official product, policy, pricing, and maintenance

  • AWS SAM CLI local testing
    Open
  • AWS SAM CLI repository
    Open
  • Install the AWS SAM CLI
    Open
  1. 1
    AWS SAM CLI local testing

    Amazon Web Services · Accessed Official

  2. 2
    AWS SAM CLI repository

    Amazon Web Services · Accessed Official

  3. 3
    Install the AWS SAM CLI

    Amazon Web Services · Accessed Official

  4. 4
    LocalStack overview

    LocalStack · Accessed Official

  5. 5
    LocalStack service coverage

    LocalStack · Accessed Official

  6. 6
    Firebase Local Emulator Suite

    Google Firebase · Accessed Official

  7. 7
    Connect and prototype with Emulator Suite

    Google Firebase · Accessed Official

  8. 8
    Supabase local development

    Supabase · Accessed Official

  9. 9
    Supabase CLI repository

    Supabase · Accessed Official