# rss-nostr-lambda

An AWS Lambda function that posts content found in an RSS feed to Nostr.

## Running Locally

### Local environment
A [nix-shell development environment](https://nixos.wiki/wiki/Development_environment_with_nix-shell) is configured in this repo. You can use it by running `nix-shell` from within the project directory. This is the easiest way to get started working with this application.

If you are not running [nix](https://nixos.wiki/wiki/Nix_package_manager) you will need to configure your environment manually. You will need the following dependencies:

- [awscliv2](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) is used for creating and updating resources in AWS.
- [LocalStack](https://docs.localstack.cloud/getting-started/) is a service that mocks AWS services locally on your machine.
- [Docker](https://docs.docker.com/engine/install/) is used by LocalStack under the hood. You'll need the Docker daemon up and running to use LocalStack.
- [awscli-local](https://github.com/localstack/awscli-local) is a thin wrapper around the awscli which provides the `awslocal` command and allows you to call awscli commands without needing to provide the `--endpoint=http://localhost:xxxx` for LocalStack on each call. 

### Makefile
A [Makefile](https://www.gnu.org/software/make/manual/make.html) has been set up to bundle some of the commands used to set up and use this Lambda.

## Running in AWS

This function runs in AWS Lambda and uses SSM to store state like the `last-run-time`. The function will read and write parameters under the `/rss-nostr-lambda` path in Parameter Store; be sure to [grant the proper permissions](https://docs.aws.amazon.com/systems-manager/latest/userguide/ps-integration-lambda-extensions.html) or this function will fail.
