Skip to content

Commit 3c98d1f

Browse files
authored
update to v6.2.1 open-source release (#501)
1 parent 3ca58b4 commit 3c98d1f

File tree

15 files changed

+62
-25
lines changed

15 files changed

+62
-25
lines changed

CHANGELOG.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,28 @@ 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-
## [6.2.0] - 2023-04-24
8+
## [6.2.1] - 2023-08-03
9+
10+
### Fixed
11+
12+
- Template fails to deploy unless demo UI is enabled [#499](https://github.com/aws-solutions/serverless-image-handler/issues/499)
13+
- Thumbor requests of images without a file extension would fail
14+
- CloudFormation template description was not being generated
15+
16+
### Changed
17+
18+
- Upgraded build requirement to Node 16
19+
20+
## [6.2.0] - 2023-08-01
921

1022
### Added
1123

12-
+ Add `cdk-helper` module to help with packaging cdk generated assets in solutions internal pipelines
13-
+ Use [DefaultStackSynthesizer](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.DefaultStackSynthesizer.html) with different configurations to generate template for `cdk deploy` and on internal solutions pipeline
14-
+ Add esbuild bundler for lambda functions using `NodejsFunction`, reference [aws_lambda_nodejs](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda_nodejs-readme.html)
15-
+ Refactor pipeline scripts
16-
+ Changes semver dependency version to 7.5.2 for github reported vulnerability CVE-2022-25883
17-
+ Changes word-wrap dependency version to aashutoshrathi/word-wrap for github reported vulnerability CVE-2023-26115
24+
- Add `cdk-helper` module to help with packaging cdk generated assets in solutions internal pipelines
25+
- Use [DefaultStackSynthesizer](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.DefaultStackSynthesizer.html) with different configurations to generate template for `cdk deploy` and on internal solutions pipeline
26+
- Add esbuild bundler for lambda functions using `NodejsFunction`, reference [aws_lambda_nodejs](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda_nodejs-readme.html)
27+
- Refactor pipeline scripts
28+
- Changes semver dependency version to 7.5.2 for github reported vulnerability CVE-2022-25883
29+
- Changes word-wrap dependency version to aashutoshrathi/word-wrap for github reported vulnerability CVE-2023-26115
1830

1931
## [6.1.2] - 2023-04-14
2032

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ In addition to the AWS Solutions Constructs, the solution uses AWS CDK directly
4444
## Prerequisites for Customization
4545

4646
- [AWS Command Line Interface](https://aws.amazon.com/cli/)
47-
- Node.js 14.x
47+
- Node.js 16.x or later
4848

4949
### 1. Clone the repository
5050

source/constructs/bin/constructs.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ if (DIST_OUTPUT_BUCKET && SOLUTION_NAME && VERSION)
1919
});
2020

2121
const app = new App();
22+
const solutionDisplayName = "Serverless Image Handler";
23+
const description = `(${app.node.tryGetContext("solutionId")}) - ${solutionDisplayName}. Version ${VERSION ?? app.node.tryGetContext("solutionVersion")}`;
2224
// eslint-disable-next-line no-new
2325
new ServerlessImageHandlerStack(app, "ServerlessImageHandlerStack", {
2426
synthesizer: synthesizer,
27+
description: description,
2528
solutionId: app.node.tryGetContext("solutionId"),
2629
solutionVersion: app.node.tryGetContext("solutionVersion"),
2730
solutionName: app.node.tryGetContext("solutionName"),

source/constructs/cdk.json

Lines changed: 1 addition & 1 deletion
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-6.2.0",
5+
"solutionVersion": "custom-v6.2.1",
66
"solutionName": "serverless-image-handler"
77
}
88
}

source/constructs/lib/common-resources/custom-resources/custom-resource-construct.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ import { Function as LambdaFunction, Runtime } from "aws-cdk-lib/aws-lambda";
77
import { NodejsFunction } from "aws-cdk-lib/aws-lambda-nodejs";
88
import { Bucket, IBucket } from "aws-cdk-lib/aws-s3";
99
import { BucketDeployment, Source as S3Source } from "aws-cdk-lib/aws-s3-deployment";
10-
import { ArnFormat, Aws, CfnCondition, CfnResource, CustomResource, Duration, Lazy, Stack } from "aws-cdk-lib";
10+
import { ArnFormat, Aspects, Aws, CfnCondition, CfnResource, CustomResource, Duration, Lazy, Stack } from "aws-cdk-lib";
1111
import { Construct } from "constructs";
1212
import { addCfnSuppressRules } from "../../../utils/utils";
1313

1414
import { SolutionConstructProps } from "../../types";
1515
import { CommonResourcesProps, Conditions } from "../common-resources-construct";
16+
import { ConditionAspect } from "../../../utils/aspects";
1617

1718
export interface CustomResourcesConstructProps extends CommonResourcesProps {
1819
readonly conditions: Conditions;
@@ -179,10 +180,11 @@ export class CustomResourcesConstruct extends Construct {
179180
public setupCopyWebsiteCustomResource(props: SetupCopyWebsiteCustomResourceProps) {
180181
// Stage static assets for the front-end from the local
181182
/* eslint-disable no-new */
182-
new BucketDeployment(this, "DeployWebsite", {
183+
const bucketDeployment = new BucketDeployment(this, "DeployWebsite", {
183184
sources: [S3Source.asset(path.join(__dirname, "../../../../demo-ui"))],
184185
destinationBucket: props.hostingBucket,
185186
});
187+
Aspects.of(bucketDeployment).add(new ConditionAspect(this.conditions.deployUICondition));
186188
}
187189

188190
public setupPutWebsiteConfigCustomResource(props: SetupPutWebsiteConfigCustomResourceProps) {

source/constructs/lib/serverless-image-stack.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import { PriceClass } from "aws-cdk-lib/aws-cloudfront";
55
import { Aspects, CfnMapping, CfnOutput, CfnParameter, Stack, StackProps, Tags } from "aws-cdk-lib";
66
import { Construct } from "constructs";
7-
import { SuppressLambdaFunctionCfnRulesAspect } from "../utils/aspects";
7+
import { ConditionAspect, SuppressLambdaFunctionCfnRulesAspect } from "../utils/aspects";
88
import { BackEnd } from "./back-end/back-end-construct";
99
import { CommonResources } from "./common-resources/common-resources-construct";
1010
import { FrontEndConstruct as FrontEnd } from "./front-end/front-end-construct";
@@ -199,6 +199,8 @@ export class ServerlessImageHandlerStack extends Stack {
199199
commonResources.customResources.setupCopyWebsiteCustomResource({
200200
hostingBucket: frontEnd.websiteHostingBucket,
201201
});
202+
const singletonFunction = this.node.findChild("Custom::CDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C");
203+
Aspects.of(singletonFunction).add(new ConditionAspect(commonResources.conditions.deployUICondition));
202204

203205
commonResources.customResources.setupPutWebsiteConfigCustomResource({
204206
hostingBucket: frontEnd.websiteHostingBucket,

source/constructs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "constructs",
3-
"version": "6.2.0",
3+
"version": "6.2.1",
44
"description": "Serverless Image Handler Constructs",
55
"license": "Apache-2.0",
66
"bin": {

source/constructs/test/__snapshots__/constructs.test.ts.snap

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ exports[`Serverless Image Handler Stack Snapshot 1`] = `
350350
"Solutions:ApplicationType": "AWS-Solutions",
351351
"Solutions:SolutionID": "S0ABC",
352352
"Solutions:SolutionName": "sih",
353-
"Solutions:SolutionVersion": "v6.2.0",
353+
"Solutions:SolutionVersion": "v6.2.1",
354354
},
355355
},
356356
"Type": "AWS::ServiceCatalogAppRegistry::Application",
@@ -1150,9 +1150,9 @@ exports[`Serverless Image Handler Stack Snapshot 1`] = `
11501150
"S3Bucket": {
11511151
"Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}",
11521152
},
1153-
"S3Key": "a0b1a27ff795cbf91cf437968a83823da180d2a071ab88a08eaadde821211f8a.zip",
1153+
"S3Key": "82f1ba8dc3b6177b733d951f282f5451925f6fb067ddd9626328d91468b7c9fc.zip",
11541154
},
1155-
"Description": "sih (v6.2.0): Performs image edits and manipulations",
1155+
"Description": "sih (v6.2.1): Performs image edits and manipulations",
11561156
"Environment": {
11571157
"Variables": {
11581158
"AUTO_WEBP": {
@@ -1419,13 +1419,13 @@ exports[`Serverless Image Handler Stack Snapshot 1`] = `
14191419
},
14201420
"S3Key": "1d9c0f7ba21ae4df4d9f33af092ffe6bf4c806ea06398e947419c4e7f091d52b.zip",
14211421
},
1422-
"Description": "sih (v6.2.0): Custom resource",
1422+
"Description": "sih (v6.2.1): Custom resource",
14231423
"Environment": {
14241424
"Variables": {
14251425
"AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1",
14261426
"RETRY_SECONDS": "5",
14271427
"SOLUTION_ID": "S0ABC",
1428-
"SOLUTION_VERSION": "v6.2.0",
1428+
"SOLUTION_VERSION": "v6.2.1",
14291429
},
14301430
},
14311431
"Handler": "index.handler",
@@ -1575,6 +1575,7 @@ exports[`Serverless Image Handler Stack Snapshot 1`] = `
15751575
"UpdateReplacePolicy": "Delete",
15761576
},
15771577
"CommonResourcesCustomResourcesDeployWebsiteAwsCliLayerBC025F39": {
1578+
"Condition": "CommonResourcesDeployDemoUICondition308D3B09",
15781579
"Properties": {
15791580
"Content": {
15801581
"S3Bucket": {
@@ -1587,6 +1588,7 @@ exports[`Serverless Image Handler Stack Snapshot 1`] = `
15871588
"Type": "AWS::Lambda::LayerVersion",
15881589
},
15891590
"CommonResourcesCustomResourcesDeployWebsiteCustomResourceECB9B136": {
1591+
"Condition": "CommonResourcesDeployDemoUICondition308D3B09",
15901592
"DeletionPolicy": "Delete",
15911593
"Properties": {
15921594
"DestinationBucketName": {
@@ -1730,6 +1732,7 @@ exports[`Serverless Image Handler Stack Snapshot 1`] = `
17301732
"Type": "AWS::IAM::Policy",
17311733
},
17321734
"CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C81C01536": {
1735+
"Condition": "CommonResourcesDeployDemoUICondition308D3B09",
17331736
"DependsOn": [
17341737
"CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRoleDefaultPolicy88902FDF",
17351738
"CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265",
@@ -1788,6 +1791,7 @@ exports[`Serverless Image Handler Stack Snapshot 1`] = `
17881791
"Type": "AWS::Lambda::Function",
17891792
},
17901793
"CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265": {
1794+
"Condition": "CommonResourcesDeployDemoUICondition308D3B09",
17911795
"Properties": {
17921796
"AssumeRolePolicyDocument": {
17931797
"Statement": [
@@ -1825,6 +1829,7 @@ exports[`Serverless Image Handler Stack Snapshot 1`] = `
18251829
"Type": "AWS::IAM::Role",
18261830
},
18271831
"CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRoleDefaultPolicy88902FDF": {
1832+
"Condition": "CommonResourcesDeployDemoUICondition308D3B09",
18281833
"Properties": {
18291834
"PolicyDocument": {
18301835
"Statement": [
@@ -1924,7 +1929,7 @@ exports[`Serverless Image Handler Stack Snapshot 1`] = `
19241929
"applicationType": "AWS-Solutions",
19251930
"solutionID": "S0ABC",
19261931
"solutionName": "sih",
1927-
"version": "v6.2.0",
1932+
"version": "v6.2.1",
19281933
},
19291934
"Description": "Attribute group for solution information",
19301935
"Name": {

source/constructs/test/constructs.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ test("Serverless Image Handler Stack Snapshot", () => {
1212
const stack = new ServerlessImageHandlerStack(app, "TestStack", {
1313
solutionId: "S0ABC",
1414
solutionName: "sih",
15-
solutionVersion: "v6.2.0",
15+
solutionVersion: "v6.2.1",
1616
});
1717

1818
const template = Template.fromStack(stack);

source/custom-resource/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "custom-resource",
3-
"version": "6.2.0",
3+
"version": "6.2.1",
44
"private": true,
55
"description": "Serverless Image Handler custom resource",
66
"license": "Apache-2.0",

0 commit comments

Comments
 (0)