Skip to content

Commit 4253975

Browse files
authored
Update to version 7.0.0 (#586)
1 parent a11bb41 commit 4253975

File tree

96 files changed

+5842
-834
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+5842
-834
lines changed

CHANGELOG.md

+40-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,51 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [7.0.0] - 2025-01-27
9+
10+
### Changed
11+
12+
- Location of API Gateway infrastructure resources
13+
- **Breaking** New condition on API gateway will cause a delete/create of ApiGateway::Deployment on stack update
14+
- **Breaking:** Exception thrown on invalid resize parameters [#463](https://github.com/aws-solutions/serverless-image-handler/pull/463)
15+
- Code formatting to align with ESLint rules
16+
- **Breaking** Reduced passthrough of errors from external APIs to response body. Errors will still be logged.
17+
- Modified CloudFront logging bucket to have versioning enabled by default
18+
- CloudFront behaviour to redirect http requests to https rather than throwing forbidden error
19+
- Set-Cookie was added to list of deny-listed response headers
20+
- Name of solution from Serverless Image Handler on AWS to Dynamic Image Transformation for Amazon CloudFront.
21+
22+
### Added
23+
24+
- Ability to enable origin shield through a deployment parameter
25+
- Ability to deploy solution without creating a CloudFront distribution
26+
- CloudFront function to normalize accept headers when AutoWebP is enabled
27+
- Alternative infrastructure using S3 Object Lambda to overcome 6 MB response size limit
28+
- Query param named expires which can be used to define when a generated image should no longer be accessible
29+
- Ability to include smart_crop as a filter for Thumbor style requests, taking advantage of AWS Rekognition face cropping
30+
- Ability to set CloudWatch log retention period to Infinite
31+
- Ability to specify Sharp input image size limit [#465](https://github.com/aws-solutions/serverless-image-handler/issues/465) [#476](https://github.com/aws-solutions/serverless-image-handler/pull/476)
32+
- Query parameter based image editing [#184](https://github.com/aws-solutions/serverless-image-handler/issues/184)
33+
- Query parameter normalization to improve cache hit rate
34+
- CloudWatch dashboard to improve Solution observability
35+
- Additional anonymized metrics to help understand how the solution is being used, identify areas of improvement, and drive future roadmap decisions.
36+
37+
### Removed
38+
39+
- Accept header being used in cache policy when AutoWebP is disabled
40+
41+
### Fixed
42+
43+
- Broken URLs in Signature and Fallback Image template parameters
44+
845
## [6.3.3] - 2024-12-27
946

1047
### Fixed
48+
1149
- Overlays not checking for valid S3 buckets
1250
- Failures when updating deployments created in version 6.1.0 and prior [#559](https://github.com/aws-solutions/serverless-image-handler/issues/559)
1351

14-
### Security
52+
### Security
1553

1654
- Added allowlist on sharp operations. [Info](https://docs.aws.amazon.com/solutions/latest/serverless-image-handler/create-and-use-image-requests.html#restricted-operations)
1755
- Added deny list on custom headers for base64 encoded requests. [Info](https://docs.aws.amazon.com/solutions/latest/serverless-image-handler/create-and-use-image-requests.html#include-custom-response-headers)
@@ -20,8 +58,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2058
## [6.3.2] - 2024-11-22
2159

2260
### Fixed
23-
- Upgrade cross-spawn to v7.0.6 for vulnerability [CVE-2024-9506](https://github.com/advisories/GHSA-5j4c-8p2g-v4jx)
2461

62+
- Upgrade cross-spawn to v7.0.6 for vulnerability [CVE-2024-9506](https://github.com/advisories/GHSA-5j4c-8p2g-v4jx)
2563

2664
## [6.3.1] - 2024-10-02
2765

NOTICE

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Serverless Image Handler
1+
Dynamic Image Transformation for Amazon CloudFront
22

33
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
44
Licensed under the Apache License Version 2.0 (the "License"). You may not use this file except
@@ -24,6 +24,7 @@ This software includes third party software subject to the following copyrights:
2424
@aws-solutions-constructs/aws-cloudfront-s3 under the Apache License 2.0
2525
@aws-solutions-constructs/core under the Apache License 2.0
2626
@popperjs/core under the Massachusetts Institute of Technology (MIT) license
27+
@types/aws-lambda under the Massachusetts Institute of Technology (MIT) license
2728
@types/color under the Massachusetts Institute of Technology (MIT) license
2829
@types/color-name under the Massachusetts Institute of Technology (MIT) license
2930
@types/jest under the Massachusetts Institute of Technology (MIT) license
@@ -55,6 +56,7 @@ ts-jest under the Massachusetts Institute of Technology (MIT) license
5556
ts-node under the Massachusetts Institute of Technology (MIT) license
5657
typescript under the Apache License 2.0
5758
uuid under the Massachusetts Institute of Technology (MIT) license
59+
dayjs under the Massachusetts Institute of Technology (MIT) license
5860
@aws-sdk/client-cloudwatch under the Apache License 2.0
5961
@aws-sdk/client-cloudwatch-logs under the Apache License 2.0
6062
@aws-sdk/client-sqs under the Apache License 2.0

README.md

+26-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
**[Serverless Image Handler](https://aws.amazon.com/solutions/implementations/serverless-image-handler/)** | **[🚧 Feature request](https://github.com/aws-solutions/serverless-image-handler/issues/new?assignees=&labels=enhancement&template=feature_request.md&title=)** | **[🐛 Bug Report](https://github.com/aws-solutions/serverless-image-handler/issues/new?assignees=&labels=bug&template=bug_report.md&title=)** | **[❓ General Question](https://github.com/aws-solutions/serverless-image-handler/issues/new?assignees=&labels=question&template=general_question.md&title=)**
1+
**[Dynamic Image Transformation for Amazon CloudFront](https://aws.amazon.com/solutions/implementations/dynamic-image-transformation-for-amazon-cloudfront/)** | **[🚧 Feature request](https://github.com/aws-solutions/serverless-image-handler/issues/new?assignees=&labels=enhancement&template=feature_request.md&title=)** | **[🐛 Bug Report](https://github.com/aws-solutions/serverless-image-handler/issues/new?assignees=&labels=bug&template=bug_report.md&title=)** | **[❓ General Question](https://github.com/aws-solutions/serverless-image-handler/issues/new?assignees=&labels=question&template=general_question.md&title=)**
22

3-
**Note**: If you want to use the solution without building from source, navigate to [Solution Landing Page](https://aws.amazon.com/solutions/implementations/serverless-image-handler/).
3+
**Note**: If you want to use the solution without building from source, navigate to [Solution Landing Page](https://aws.amazon.com/solutions/implementations/dynamic-image-transformation-for-amazon-cloudfront/).
44

55
## Table of Content
66

@@ -18,17 +18,26 @@
1818

1919
# Solution Overview
2020

21-
The Serverless Image Handler solution helps to embed images on websites and mobile applications to drive user engagement. It uses [Sharp](https://sharp.pixelplumbing.com/en/stable/) to provide high-speed image processing without sacrificing image quality. To minimize costs of image optimization, manipulation, and processing, this solution automates version control and provides flexible storage and compute options for file reprocessing.
21+
The Dynamic Image Transformation for Amazon CloudFront solution helps to embed images on websites and mobile applications to drive user engagement. It uses [Sharp](https://sharp.pixelplumbing.com/en/stable/) to provide high-speed image processing without sacrificing image quality. To minimize costs of image optimization, manipulation, and processing, this solution automates version control and provides flexible storage and compute options for file reprocessing.
2222

2323
This solution automatically deploys and configures a serverless architecture optimized for dynamic image manipulation. Images can be rendered and returned spontaneously. For example, an image can be resized based on different screen sizes by adding code on a website that leverages this solution to resize the image before being sent to the screen using the image. It uses [Amazon CloudFront](https://aws.amazon.com/cloudfront) for global content delivery and [Amazon Simple Storage Service](https://aws.amazon.com/s3) (Amazon S3) for reliable and durable cloud storage.
2424

25-
For more information and a detailed deployment guide, visit the [Serverless Image Handler](https://aws.amazon.com/solutions/implementations/serverless-image-handler/) solution page.
25+
For more information and a detailed deployment guide, visit the [Dynamic Image Transformation for Amazon CloudFront](https://aws.amazon.com/solutions/implementations/dynamic-image-transformation-for-amazon-cloudfront/) solution page.
2626

2727
# Architecture Diagram
2828

29-
![Architecture Diagram](./architecture.png)
29+
Dynamic Image Transformation for Amazon CloudFront supports two architectures, one using an Amazon API Gateway REST API, and another using S3 Object Lambda. The Amazon API Gateway REST API architecture maintains the structure used in v6.3.3 and below of the Dynamic Image Transformation for Amazon CloudFront. The S3 Object Lambda architecture maintains very similar functionality, while also allowing for images larger than 6 MB to be returned. For more information, refer to the [Architecture Overview](https://docs.aws.amazon.com/solutions/latest/serverless-image-handler/architecture-overview.html) in the implementation guide.
30+
31+
The AWS CloudFormation template deploys an Amazon CloudFront distribution, Amazon API Gateway REST API/S3 Object Lambda, and an AWS Lambda function. Amazon CloudFront provides a caching layer to reduce the cost of image processing and the latency of subsequent image delivery. The Amazon API Gateway/S3 Object Lambda provides endpoint resources and triggers the AWS Lambda function. The AWS Lambda function retrieves the image from the customer's Amazon Simple Storage Service (Amazon S3) bucket and uses Sharp to return a modified version of the image. Additionally, the solution generates a CloudFront domain name that provides cached access to the image handler API. There is limited use of CloudFront functions for consistency and cache hit rate purposes.
32+
33+
## Default Architecture
34+
35+
![Architecture Diagram (Default Architecture)](./default_architecture.png)
36+
37+
## S3 Object Lambda Architecture
38+
39+
![Architecture Diagram (S3 Object Lambda Architecture)](./object_lambda_architecture.png)
3040

31-
The AWS CloudFormation template deploys an Amazon CloudFront distribution, Amazon API Gateway REST API, and an AWS Lambda function. Amazon CloudFront provides a caching layer to reduce the cost of image processing and the latency of subsequent image delivery. The Amazon API Gateway provides endpoint resources and triggers the AWS Lambda function. The AWS Lambda function retrieves the image from the customer's Amazon Simple Storage Service (Amazon S3) bucket and uses Sharp to return a modified version of the image to the API Gateway. Additionally, the solution generates a CloudFront domain name that provides cached access to the image handler API.
3241

3342
# AWS CDK and Solutions Constructs
3443

@@ -49,8 +58,8 @@ In addition to the AWS Solutions Constructs, the solution uses AWS CDK directly
4958
### 1. Clone the repository
5059

5160
```bash
52-
git clone https://github.com/aws-solutions/serverless-image-handler.git
53-
cd serverless-image-handler
61+
git clone https://github.com/aws-solutions/dynamic-image-transformation-for-amazon-cloudfront.git
62+
cd dynamic-image-transformation-for-amazon-cloudfront
5463
export MAIN_DIRECTORY=$PWD
5564
```
5665

@@ -76,12 +85,12 @@ overrideWarningsEnabled=false npx cdk deploy\
7685
```
7786

7887
_Note:_
79-
- **MY_BUCKET**: name of an existing bucket in your account
88+
- **MY_BUCKET**: name of an existing bucket or the list of comma-separated bucket names in your account
8089
- **PROFILE_NAME**: name of an AWS CLI profile that has appropriate credentials for deploying in your preferred region
8190

8291
# Collection of operational metrics
8392

84-
This solution collects anonymous operational metrics to help AWS improve the quality and features of the solution. For more information, including how to disable this capability, please see the [implementation guide](https://docs.aws.amazon.com/solutions/latest/serverless-image-handler/op-metrics.html).
93+
This solution collects anonymous operational metrics to help AWS improve the quality and features of the solution. For more information, including how to disable this capability, please see the [implementation guide](https://docs.aws.amazon.com/solutions/latest/serverless-image-handler/reference.html#anonymized-data-collection).
8594

8695
# External Contributors
8796

@@ -105,10 +114,15 @@ This solution collects anonymous operational metrics to help AWS improve the qua
105114
- [@Fjool](https://github.com/Fjool) for [#489](https://github.com/aws-solutions/serverless-image-handler/pull/489)
106115
- [@fvsnippets](https://github.com/fvsnippets) for [#373](https://github.com/aws-solutions/serverless-image-handler/pull/373), [#380](https://github.com/aws-solutions/serverless-image-handler/pull/380)
107116
- [@ccchapman](https://github.com/ccchapman) for [#490](https://github.com/aws-solutions/serverless-image-handler/pull/490)
108-
- [@bennet-esyoil](https://github.com/bennet-esyoil) for [#521](https://github.com/aws-solutions/serverless-image-handler/pull/521)
109-
- [@vaniyokk](https://github.com/vaniyokk) for [#511](https://github.com/aws-solutions/serverless-image-handler/pull/511)
117+
- [@bennet-esyoil][https://github.com/bennet-esyoil] for [#521](https://github.com/aws-solutions/serverless-image-handler/pull/521)
118+
- [@vaniyokk][https://github.com/vaniyokk] for [#511](https://github.com/aws-solutions/serverless-image-handler/pull/511)
119+
- [@ericbuehl](https://github.com/ericbuehl) for [#463](https://github.com/aws-solutions/serverless-image-handler/pull/463)
120+
- [@fvsnippets](https://github.com/fvsnippets) for [#372](https://github.com/aws-solutions/serverless-image-handler/pull/372)
121+
- [@markuscolourbox](https://github.com/markuscolourbox) for [#349](https://github.com/aws-solutions/serverless-image-handler/pull/349)
122+
- [@madhubalaji](https://github.com/madhubalaji) for [#476](https://github.com/aws-solutions/serverless-image-handler/pull/476)
110123
- [@nicolasbuch](https://github.com/nicolasbuch) for [#569](https://github.com/aws-solutions/serverless-image-handler/pull/569)
111124
- [@mrnonz](https://github.com/mrnonz) for [#567](https://github.com/aws-solutions/serverless-image-handler/pull/567)
125+
- [@ilich](https://github.com/ilich) for [#574](https://github.com/aws-solutions/serverless-image-handler/pull/574)
112126

113127
# License
114128

VERSION.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.3.3
1+
7.0.0

default_architecture.png

135 KB
Loading

deployment/cdk-solution-helper/asset-packager/asset-packager.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import AdmZip from "adm-zip";
1212
* on solution internal pipelines
1313
*/
1414
export class CDKAssetPackager {
15-
constructor(private readonly assetFolderPath: string) {}
15+
constructor(private readonly assetFolderPath: string) { }
1616

1717
/**
1818
* @description get cdk asset paths

object_lambda_architecture.png

127 KB
Loading

source/.eslintrc.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"jsdoc/require-returns-type": ["off"],
4141
"jsdoc/newline-after-description": ["off"],
4242

43-
"import/no-unresolved": 1 // warn only on Unable to resolve path import/no-unresolved
43+
"import/no-unresolved": 1, // warn only on Unable to resolve path import/no-unresolved
44+
"dot-notation": "off"
4445
}
4546
}

source/constructs/bin/constructs.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if (DIST_OUTPUT_BUCKET && SOLUTION_NAME && VERSION)
1919
});
2020

2121
const app = new App();
22-
const solutionDisplayName = "Serverless Image Handler";
22+
const solutionDisplayName = "Dynamic Image Transformation for Amazon CloudFront";
2323
const solutionVersion = VERSION ?? app.node.tryGetContext("solutionVersion");
2424
const description = `(${app.node.tryGetContext("solutionId")}) - ${solutionDisplayName}. Version ${solutionVersion}`;
2525
// eslint-disable-next-line no-new

source/constructs/cdk.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"app": "npx ts-node --prefer-ts-exts bin/constructs.ts",
33
"context": {
44
"solutionId": "SO0023",
5-
"solutionVersion": "custom-v6.3.3",
6-
"solutionName": "serverless-image-handler"
5+
"solutionVersion": "custom-v7.0.0",
6+
"solutionName": "dynamic-image-transformation-for-amazon-cloudfront"
77
}
88
}

0 commit comments

Comments
 (0)