Skip to content
This repository has been archived by the owner on Sep 18, 2020. It is now read-only.

Commit

Permalink
Update to latest AWS Lambda runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
kalinchernev committed Apr 10, 2018
1 parent 715e01b commit a26f424
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"env",
{
"targets": {
"node": "6.10"
"node": "8.10"
},
"modules": false,
"loose": true
Expand All @@ -18,7 +18,7 @@
"env",
{
"targets": {
"node": "6.10"
"node": "8.10"
}
}
]
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
[![codecov](https://codecov.io/gh/kalinchernev/aws-node-signed-uploads/branch/master/graph/badge.svg)](https://codecov.io/gh/kalinchernev/aws-node-signed-uploads)
[![Build Status](https://travis-ci.org/kalinchernev/aws-node-signed-uploads.svg?branch=master)](https://travis-ci.org/kalinchernev/aws-node-signed-uploads)

Use this approach when you want or have to use [Amazon API Gateway](https://aws.amazon.com/api-gateway/) and you want to solve the 10MB payload limit.
If you have landed to this project out of curiosity for the technologies behind the service, you can see implementation details in [this article](https://kalinchernev.github.io/tdd-serverless-jest).

The service is based on the [serverless](https://serverless.com/) framework and solves a simple problem - uploading objects to a specific S3 bucket using [pre-signed URL](http://docs.aws.amazon.com/AmazonS3/latest/dev/PresignedUrlUploadObject.html)s. Implemented in node.js runtime using [getSignedUrl](http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#getSignedUrl-property) method.
The approach implemented in this service is useful when you want to use [Amazon API Gateway](https://aws.amazon.com/api-gateway/) and you want to solve the 10MB payload limit.

The service is based on the [serverless](https://serverless.com/) framework. The service is uploading objects to a specific S3 bucket using a [pre-signed URL](http://docs.aws.amazon.com/AmazonS3/latest/dev/PresignedUrlUploadObject.html). Implemented in node.js runtime using [getSignedUrl](http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#getSignedUrl-property) method.

## Requirements

* Node.js >= 6.9.1
* npm >= 3.10.8

The package is targeting the latest possible 6.x of AWS Lambda.
The package is targeting the latest runtime of AWS Lambda. ([8.10](https://aws.amazon.com/blogs/compute/node-js-8-10-runtime-now-available-in-aws-lambda/))

## Security

Expand Down
8 changes: 6 additions & 2 deletions serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ plugins:
- serverless-offline #serverless-offline needs to be last in the list

custom:
webpackIncludeModules: true
webpack:
webpackConfig: 'webpack.config.js'
includeModules: true
packager: 'yarn'
# packExternalModulesMaxBuffer: 200 * 1024
serverless-offline:
port: 4000

provider:
name: aws
runtime: nodejs6.10
runtime: nodejs8.10
stage: ${opt:stage, file(config.json):stage, 'dev'}
region: ${opt:region, file(config.json):region, 'eu-central-1'}
environment:
Expand Down
4 changes: 2 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ module.exports = {
target: 'node',
externals: [{ 'aws-sdk': true }],
module: {
loaders: [
rules: [
{
test: /\.js$/,
loaders: ['babel-loader'],
include: __dirname,
exclude: /node_modules/,
use: [{ loader: 'babel-loader' }],
},
],
},
Expand Down

0 comments on commit a26f424

Please sign in to comment.