Skip to content

Commit

Permalink
Merge pull request #25 from texpert/develop
Browse files Browse the repository at this point in the history
Release v.0.1.0
  • Loading branch information
texpert authored Nov 19, 2023
2 parents 0f367e1 + 92bb65e commit de64792
Show file tree
Hide file tree
Showing 6 changed files with 687 additions and 606 deletions.
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
yarn 1.22.19
nodejs 16.19.0
nodejs 20.9.0
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ An [AWS Lambda][aws_lambda] function for resizing images on demand.

Built using the [sharp][sharp] image resizing JS library, and running on the [Node.js][nodejs] runtime.

_Note: currently Sharp is being built on Node.js version 10.x_
_Note: currently Sharp is being built on Node.js version 20.x_

On invocation, the Lambda function will fetch the image from the 'original' S3 bucket, resize the image, upload both
the original and the resized image to the target S3 bucket, and return the resulting filenames to a specified
Expand Down Expand Up @@ -54,13 +54,16 @@ On MacOS:

### Local testing

Or, to invoke and debug locally, run the `lambda_start.js` module, which uses the [Commandline tool to run Amazon Lambda function on local machines][lambda-local]:
To invoke and debug locally:

- Upload the `florsan_homepage.png` file into the `cache` AWS S3 bucket
- Run the `lambda_start.js` module, which uses the [Commandline tool to run Amazon Lambda function on local machines][lambda-local]:

```
$ node test/lambda_start.js
```

Install globally the [AWS SAM Local][aws_sam_local] package.
Or, install globally the [AWS SAM Local][aws_sam_local] package.

```
$ npm install -g aws-sam-local
Expand Down Expand Up @@ -217,4 +220,4 @@ This [AWS Lambda][aws_lambda] function is [licensed][license] under Apache 2.0.
[lambda-local]: https://github.com/ashiina/lambda-local
[license]: LICENSE
[nodejs]: https://nodejs.org/en/
[sharp]: https://github.com/lovell/sharp
[sharp]: https://github.com/lovell/sharp
Binary file added florsan_homepage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": "lambda-image-resize.js",
"version": "0.0.3",
"version": "0.1.0",
"description": "On demand image resizing AWS Lambda function",
"author": "Aurel Branzeanu <branzeanu.aurel@gmail.com>",
"license": "Apache-2.0",
"main": "index.js",
"dependencies": {
"node-gyp": "^5.0.7",
"node-gyp": "^10.0.1",
"sharp": "^0.32.6"
},
"devDependencies": {
"aws-sdk": "^2.596",
"lambda-local": "^1.6.3"
"aws-sdk": "^2.1499",
"lambda-local": "^2.1.2"
},
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Resources:
Properties:
CodeUri: ./
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs20.x
MemorySize: 1536
Timeout: 60

Expand All @@ -16,4 +16,4 @@ Resources:
Properties:
FunctionName: !Ref ImageResizeOnDemand
Action: lambda:InvokeFunction
Principal: "arn:aws:iam::978552873556:user/texpert"
Principal: "arn:aws:iam::978552873556:user/texpert"
Loading

0 comments on commit de64792

Please # to comment.