Skip to content

Latest commit

 

History

History
62 lines (42 loc) · 1.73 KB

README.md

File metadata and controls

62 lines (42 loc) · 1.73 KB

SNS Bridge

SNS Bridge

Use SNS Bridge to connect your local development for Chalice apps to Amazon SNS

How it Works

  1. An HTTP server is started on your local machine
  2. An ngrok tunnel is opened to the HTTP server
  3. SNS Bridge subscribes the ngrok tunnel to your SNS topic
  4. When a message is received, your SNS function is imported and called. This is done in a separate process each time to allow hot reloading.
  5. When finished, SNS bridge cleans up after itself and unsubscribes from the topic. Assuming you don't force quit.

Getting Started

Pre-requisites

  1. Setup an ngrok account.
  2. Download and install their CLI tool and set your API key.

Installation

Using Poetry (recommended):

poetry add --dev sns_bridge

If using PIP (not recommended as the SNS Bridge requirements might pollute your Chalice app requierements):

pip install sns_bridge

Usage

You may always use sns_bridge --help to access this information.

Usage: sns_bridge [OPTIONS]

Options:
  --role-arn TEXT    ARN of the role to assume
  --port INTEGER     Port number to run
  --topic-name TEXT  SNS topic name  [required]
  --help             Show this message and exit.

topic-name

The only required parameter, this is the name of the SNS topic you wish to subscribe to.

role-arn

Optional. If you are using a multi-tier AWS account setup that requires you to "switch" or "assume" roles in order to work with resources, pass the appropriate role ARN here.

port

Optional. Defaults to a very high port number, 65500. Pass in a new port number if necessary.