-
install AWS cli https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html
-
install AWS SAM CLI (including docker) https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html
-
install nodejs version 12 + npm
# setup aws connection
aws configure
-
Create one of your teams SQS queue All default are ok, when created note down both url and arn
-
Create your teams nosql database nosql dynamodb setup tip
# install existing depedencies
cd src/fn-sourceAdapterReddit/
npm install
# Execute function locally, optional add --skip-pull-image
sam local invoke FnTrollEventHandler --event ./events/trollEvent.json -t templates/core-troll-alerting-service.yaml
sam local invoke FnSourceAdapterReddit --event ./events/testEvents.json -t templates/event-source-adapters.yaml
sam local invoke FnChannelHandlerMSTeams --event ./events/msTeamsEvent.json -t templates/notification-channel-handlers.yaml --skip-pull-image
# Adding new npm dependencies to function
npm install --save snoowrap
# creating new function
cd src/
mkdir fn-xxxx
cd fn-xxxx
npm init #All defaults are ok
# see inside script for more info
bash deployAdapters.sh
bash deployChannels.sh
bash deployCore.sh
- https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/
- https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/sqs-examples-send-receive-messages.html
- https://browntreelabs.com/scraping-reddits-api-with-snoowrap/
- https://www.reddit.com/prefs/apps
- https://github.com/not-an-aardvark/snoowrap
- https://not-an-aardvark.github.io/reddit-oauth-helper/
- https://not-an-aardvark.github.io/snoowrap/Subreddit.html#getTop__anchor
aws configure list
export AWS_PROFILE=yourprofile