Skip to content

Release v.0.1.0 #25

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

Merged
merged 6 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
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 <[email protected]>",
"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