JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 58320
  • Score
    100M100P100Q169400F
  • License MIT

Emulate AWS λ and SQS locally when developing your Serverless project

Package Exports

  • serverless-offline-sqs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (serverless-offline-sqs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

serverless-offline-sqs

This Serverless-offline plugin emulates AWS λ and SQS queue on your local machine. To do so, it listens SQS queue and invokes your handlers.

Features:

Installation

First, add serverless-offline-sqs to your project:

npm install serverless-offline-sqs

Then inside your project's serverless.yml file, add following entry to the plugins section before serverless-offline (and after serverless-webpack if presents): serverless-offline-sqs.

plugins:
  - serverless-webpack
  - serverless-offline-sqs
  - serverless-offline

See example

Configure

Functions

Ths configuration of function of the plugin follows the serverless documentation.

functions:
  mySQSHandler:
    handler: handler.compute
    events:
      - sqs: arn:aws:sqs:region:XXXXXX:MyFirstQueue
      - sqs:
          arn: arn:aws:sqs:region:XXXXXX:MySecondQueue
      - sqs:
          queueName: MyThirdQueue
          arn:
            Fn::GetAtt:
              - MyThirdQueue
              - Arn
      - sqs:
          arn:
            Fn::GetAtt:
              - MyFourthQueue
              - Arn
resources:
  Resources:
    MyFirstQueue:
      Type: AWS::SQS::Queue
      Properties:
        QueueName: MyFourthQueue

SQS

The configuration of aws.SQS's client of the plugin is done by defining a custom: serverless-offline-sqs object in your serverless.yml with your specific configuration.

You could use ElasticMQ with the following configuration:

custom:
  serverless-offline-sqs:
    apiVersion: '2012-11-05'
    endpoint: http://0.0.0.0:9324
    region: eu-west-1
    accessKeyId: root
    secretAccessKey: root