|
1 | | -**_Important Notice:_** |
2 | | -Due to a [change in the AWS Lambda execution environment](https://aws.amazon.com/blogs/compute/upcoming-updates-to-the-aws-lambda-execution-environment/), Serverless Image Handler v3 deployments are functionally broken. To address the issue we have released [minor version update v3.1.1](https://solutions-reference.s3.amazonaws.com/serverless-image-handler/v3.1.1/serverless-image-handler.template). We recommend all users of v3 to run cloudformation stack update with v3.1.1. Additionally, we suggest you to look at v4 of the solution and migrate to v4 if it addresses all of your use cases. |
3 | 1 |
|
4 | | -# AWS Serverless Image Handler Lambda wrapper for SharpJS |
5 | | -A solution to dynamically handle images on the fly, utilizing Sharp (https://sharp.pixelplumbing.com/en/stable/). |
6 | | -Published version, additional details and documentation are available here: https://aws.amazon.com/solutions/serverless-image-handler/ |
7 | 2 |
|
8 | | -_Note:_ it is recommend to build the application binary on Amazon Linux. |
| 3 | +## Usage |
9 | 4 |
|
10 | | -## Building distributable for customization |
11 | | -* Clone the repository, then make the desired code changes |
12 | 5 | ```bash |
13 | | -git clone https://github.com/awslabs/serverless-image-handler.git |
| 6 | +./atlas-deploy.sh deploy_stack|build|update |
14 | 7 | ``` |
15 | 8 |
|
16 | | -* Run unit tests to make sure added customization passes the tests: |
17 | | -``` |
18 | | -cd ./deployment |
19 | | -chmod +x ./run-unit-tests.sh |
20 | | -./run-unit-tests.sh |
21 | | -``` |
22 | | - |
23 | | -* Create an Amazon S3 Bucket |
24 | | -``` |
25 | | -aws s3 mb s3://my-bucket-us-east-1 --region us-east-1 |
26 | | -``` |
27 | | - |
28 | | -* Navigate to the deployment folder and build the distributable |
29 | | -```bash |
30 | | -chmod +x ./build-s3-dist.sh |
31 | | -./build-s3-dist.sh my-bucket serverless-image-handler my-version |
32 | | -``` |
33 | | - |
34 | | -> Note: The build-s3-dist script expects the bucket name as one of its parameters, and this value should not include the region suffix. |
35 | | -
|
36 | | -* Deploy the distributable to an Amazon S3 bucket in your account (you must have the AWS CLI installed) |
37 | | -```bash |
38 | | -aws s3 cp ./regional-s3-assets/ s3://my-bucket-us-east-1/serverless-image-handler/my-version/ --recursive --acl bucket-owner-full-control |
39 | | -``` |
40 | | - |
41 | | -* Get the link of the serverless-image-handler.template uploaded to your Amazon S3 bucket |
42 | | - |
43 | | -* Deploy the Serverless Image Handler solution to your account by launching a new AWS CloudFormation stack using the link of the serverless-image-handler.template |
| 9 | +* `deploy_stack`: Deploy Cloudformation stack |
| 10 | +* `build`: Build & package image handler function |
| 11 | +* `update`: Trigger lambda function update from built code from s3 |
44 | 12 |
|
45 | 13 | *** |
46 | 14 |
|
|
0 commit comments