/aws-sam-messaging-services-integration

Using AWS messaging services in serverless applications with AWS SAM. Questions? @jbesw

Primary LanguageJavaScriptMIT No AttributionMIT-0

Messaging services in serverless applications

The examples in this repo are used in related messaging blog posts. You can read the blog posts at:

Important: these applications use various AWS services and there are costs associated with these services after the Free Tier usage. Please see the AWS Pricing page for details. You are responsible for any AWS costs incurred. No warranty is implied in these examples.

.
├── README.MD          <-- This instructions file
├── 1-sqs              <-- Integrates an SQS queue with a Lambda function
└── 2-sns              <-- Integrates an SNS topic with a Lambda function
└── 3-eventbridge      <-- Creates an EventBridge rule with a Lambda function as a target
└── 4-sns-sqs          <-- Subscribes an SQS queue to an SNS topic
└── 5-eventbridge-sns  <-- Creates an EventBridge rule with an SNS topic as a target
└── 6-eventbridge-sqs  <-- Creates an EventBridge rule with an SQS queue as a target

Requirements

Installation Instructions

  1. Create an AWS account if you do not already have one and login.

  2. Clone the repo onto your local development machine using git clone.

  3. In each example's directory, from the command line, run:

sam deploy --guided

Follow the prompts in the deploy process to set the stack name and AWS Region.

Testing

The SAM deployment provides key resource names in the output.

Invoke a Lambda function from the CLI using:

aws lambda invoke --function-name << your-function-name >> response.json

Tail the function's CloudWatch logs using:

sam logs -n sqs-example-QueueConsumerFunction-M1GVFCEH030D --tail

With a test event in a local event.json file, send the event to the Amazon EventBridge using:

aws events put-events --entries file://event.json

Questions?

Please raise an issue on this repo.

==============================================

Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.

SPDX-License-Identifier: MIT-0