Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add some more config options #84

Merged
merged 14 commits into from
Nov 3, 2020
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
module.exports = {
"env": {
"commonjs": true,
"browser": true,
"jest": true,
"es2020": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 11
}
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
env: {
commonjs: true,
browser: true,
jest: true,
es2020: true
},
parserOptions: {
ecmaVersion: 11
}
};
4 changes: 3 additions & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
run: yarn run type-coverage
- name: Test
run: yarn run test
- name: Package example service to ensure compatibility
run: cd example-service && yarn install --frozen-lockfile && yarn sls package
- name: Run Semantic Release
run: yarn semantic-release
if: matrix.node-version == '12.x'
if: matrix.node-version == '12.x'
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,12 @@ jspm_packages
# Serverless directories
**/.serverless
node_modules
/.idea

# VS Code
.vscode
*.code-workspace
.history

# tsc output
dist
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
.serverless
dist
.build
coverage
.webpack
generated
CHANGELOG.md
4 changes: 4 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"trailingComma": "none",
"arrowParens": "avoid"
}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# Serverless Sns Sqs Lambda

[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com)
[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)
[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)
![Github Actions Status](https://github.com/agiledigital/serverless-sns-sqs-lambda/workflows/Node.js%20CI/badge.svg?branch=master)
[![Type Coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Fagiledigital%2Fserverless-sns-sqs-lambda%2Fmaster%2Fpackage.json)](https://github.com/plantain-00/type-coverage)
[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/agiledigital/serverless-sns-sqs-lambda.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/agiledigital/serverless-sns-sqs-lambda/context:javascript)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
![npm](https://img.shields.io/npm/v/@agiledigital/serverless-sns-sqs-lambda)


This is a Serverless Framework plugin for AWS lambda Functions. Currently, it
is possible to subscribe directly to an SNS topic. However, if you want to
provide retry capability and error handling, you need to write a whole lot of
Expand Down Expand Up @@ -51,7 +50,8 @@ functions:
batchSize: 2 # Optional - default value is 10
maxRetryCount: 2 # Optional - default value is 5
kmsMasterKeyId: alias/aws/sqs # optional - default is none (no encryption)
kmsDataKeyReusePeriodSeconds: 600 # optional - AWS default is 300 seconds
kmsDataKeyReusePeriodSeconds: 600 # optional - AWS default is 300 seconds
rawMessageDelivery: true # Optional - default value is true
filterPolicy: # Optional - filter messages that are handled
pets:
- dog
Expand All @@ -65,5 +65,5 @@ resources:
TopicName: TestTopic

plugins:
- '@agiledigital/serverless-sns-sqs-lambda'
- "@agiledigital/serverless-sns-sqs-lambda"
```
13 changes: 0 additions & 13 deletions example-service/package-lock.json

This file was deleted.

5 changes: 3 additions & 2 deletions example-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"serverless-sns-sqs-lambda": "0.0.8"
"devDependencies": {
"@agiledigital/serverless-sns-sqs-lambda": "file:../",
"serverless": "^2.0.0"
}
}
6 changes: 5 additions & 1 deletion example-service/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ functions:
topicArn: ${self:custom.topicArn}
batchSize: 2
maxRetryCount: 2
kmsMasterKeyId: alias/aws/sqs
kmsDataKeyReusePeriodSeconds: 600
visibilityTimeout: 120
rawMessageDelivery: true
filterPolicy:
pet:
- dog
Expand All @@ -31,4 +35,4 @@ resources:
TopicName: TestTopic

plugins:
- '@agiledigital/serverless-sns-sqs-lambda'
- "@agiledigital/serverless-sns-sqs-lambda"
Loading