Skip to content

Commit 1053e97

Browse files
authored
Upgrade to version v2.1.1
### Changed - AWS Lambda runtime for Nodejs from 20.x to 22.x - Updated pyproject.toml spec updated to use python 3.12 or higher - AWS SDK (boto3 and Javascript SDK) version updates - Updated warnings and references documentation when selecting 'BYO Cognito user pool'. ### Fixed - An issue with RAG based deployment, specifically when using Anthropic Claude 3.5 v2 under Amazon Bedrock that caused incorrect prompt to be associated with the configuration. - An issue related to streaming responses in use case deployments, specifically when using Llama 3.2 under Amazon Bedrock. ### Security - Updated node library versions to address security vulnerabilities
2 parents ea1883a + 8a38ed6 commit 1053e97

File tree

87 files changed

+8384
-7407
lines changed

Some content is hidden

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

87 files changed

+8384
-7407
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,7 @@ bak.*
5858
_bandit_temp.json
5959
RapidAi.code-workspace
6060
source/scripts/v2_migration/poetry.lock
61+
62+
.temp_redpencil
63+
bom.json
64+
bom.xml

CHANGELOG.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,24 @@ 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+
## [2.1.1] - 2024-12-17
9+
10+
### Changed
11+
12+
- AWS Lambda runtime for Nodejs from 20.x to 22.x
13+
- Updated `pyproject.toml` spec updated to use python 3.12 or higher
14+
- AWS SDK (boto3 and Javascript SDK) version updates
15+
- Updated warnings and references documentation when selecting 'BYO Cognito user pool'.
16+
17+
### Fixed
18+
19+
- An issue with RAG based deployment, specifically when using Anthropic Claude 3.5 v2 under Amazon Bedrock that caused incorrect prompt to be associated with the configuration.
20+
- An issue related to streaming responses in use case deployments, specifically when using Llama 3.2 under Amazon Bedrock.
21+
22+
### Security
23+
24+
- Updated node library versions to address security vulnerabilities
25+
826
## [2.1.0] - 2024-11-20
927

1028
### Added
@@ -243,4 +261,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
243261

244262
### Added
245263

246-
- Initial Release
264+
- Initial Release

NOTICE.txt

Lines changed: 1508 additions & 231 deletions
Large diffs are not rendered by default.

deployment/build-s3-dist.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ set -e
4040
# Check to see if input has been provided:
4141
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ] || [ -z "$4" ]; then
4242
echo "Please provide all required parameters for the build script"
43-
echo "For example: ./build-s3-dist.sh solutions trademarked-solution-name v2.1.0 template-bucket-name"
43+
echo "For example: ./build-s3-dist.sh solutions trademarked-solution-name v2.1.1 template-bucket-name"
4444
exit 1
4545
fi
4646

source/infrastructure/bin/gen-ai-app-builder.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { BaseStack, BaseStackProps } from '../lib/framework/base-stack';
2222
import { SageMakerChat } from '../lib/sagemaker-chat-stack';
2323
import { AppRegistry } from '../lib/utils/app-registry-aspects';
2424
import { LambdaAspects } from '../lib/utils/lambda-aspect';
25+
import { LambdaVersionCDKNagSuppression } from '../lib/utils/lambda-version-cdk-nag-suppression';
2526
import { LogGroupRetentionCheckAspect } from '../lib/utils/log-group-retention-check-aspect';
2627

2728
const app = new cdk.App();
@@ -43,6 +44,7 @@ createStack(DeploymentPlatformStack, getDefaultBaseStackProps(DeploymentPlatform
4344
// adding cdk-nag checks
4445
cdk.Aspects.of(app).add(new AwsSolutionsChecks());
4546
cdk.Aspects.of(app).add(new LogGroupRetentionCheckAspect());
47+
cdk.Aspects.of(app).add(new LambdaVersionCDKNagSuppression());
4648

4749
app.synth();
4850

source/infrastructure/cdk.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
22
"app": "../pre-build-lambda-layers.sh && npx ts-node --prefer-ts-exts bin/gen-ai-app-builder.ts",
33
"watch": {
4-
"include": ["**"],
4+
"include": [
5+
"**"
6+
],
57
"exclude": [
68
"README.md",
79
"cdk*.json",
@@ -17,7 +19,10 @@
1719
"context": {
1820
"@aws-cdk/aws-lambda:recognizeLayerVersion": true,
1921
"@aws-cdk/core:checkSecretUsage": true,
20-
"@aws-cdk/core:target-partitions": ["aws", "aws-cn"],
22+
"@aws-cdk/core:target-partitions": [
23+
"aws",
24+
"aws-cn"
25+
],
2126
"@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true,
2227
"@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true,
2328
"@aws-cdk/aws-ecs:arnFormatIncludesClusterName": true,
@@ -58,10 +63,10 @@
5863
"@custom-bundler/unit-test": false,
5964
"solution_id": "SO0276",
6065
"solution_name": "generative-ai-application-builder-on-aws",
61-
"solution_version": "v2.1.0",
66+
"solution_version": "v2.1.1",
6267
"app_registry_name": "GAAB",
6368
"application_type": "AWS-Solutions",
6469
"application_trademark_name": "Generative AI Application Builder on AWS",
6570
"cdk-asset-bucket": "cdk-hnb659fds-assets-123456789012-us-east-1"
6671
}
67-
}
72+
}

source/infrastructure/lib/use-case-management/management-stack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ export class UseCaseManagement extends BaseNestedStack {
286286
}
287287

288288
const lambdaDlq = new sqs.Queue(this, 'UseCaseManagementDLQ', {
289-
encryption: sqs.QueueEncryption.SQS_MANAGED,
289+
encryption: sqs.QueueEncryption.KMS_MANAGED,
290290
enforceSSL: true
291291
});
292292

source/infrastructure/lib/utils/constants.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ export const INTERNAL_EMAIL_DOMAIN = 'amazon';
2323
export const LAMBDA_TIMEOUT_MINS = 15;
2424
export const API_GATEWAY_THROTTLING_RATE_LIMIT = 5;
2525
export const API_GATEWAY_THROTTLING_BURST_LIMIT = 5;
26-
export const COMMERCIAL_REGION_LAMBDA_NODE_RUNTIME: lambda.Runtime = lambda.Runtime.NODEJS_20_X;
26+
export const COMMERCIAL_REGION_LAMBDA_NODE_RUNTIME: lambda.Runtime = lambda.Runtime.NODEJS_22_X;
2727
export const GOV_CLOUD_REGION_LAMBDA_NODE_RUNTIME: lambda.Runtime = lambda.Runtime.NODEJS_18_X;
2828
export const COMMERCIAL_REGION_LAMBDA_PYTHON_RUNTIME: lambda.Runtime = lambda.Runtime.PYTHON_3_12;
2929
export const COMMERCIAL_REGION_LAMBDA_LAYER_PYTHON_RUNTIME: string = 'python_lambda_layer_3_12';
3030
export const LANGCHAIN_LAMBDA_PYTHON_RUNTIME: lambda.Runtime = lambda.Runtime.PYTHON_3_12;
3131
export const CHAT_LAMBDA_PYTHON_RUNTIME: string = 'python_lambda_3_12_with_args';
3232
export const LANGCHAIN_LAMBDA_LAYER_PYTHON_RUNTIME: string = 'langchain_python_3_12_with_args';
33-
export const COMMERCIAL_REGION_LAMBDA_NODE_TS_LAYER_RUNTIME: string = 'node_ts_lambda_20_x_layer';
34-
export const COMMERCIAL_REGION_LAMBDA_JS_LAYER_RUNTIME: string = 'node_js_lambda_20_x_layer';
35-
export const GOV_CLOUD_REGION_LAMBDA_PYTHON_RUNTIME: lambda.Runtime = lambda.Runtime.PYTHON_3_10;
33+
export const COMMERCIAL_REGION_LAMBDA_NODE_TS_LAYER_RUNTIME: string = 'node_ts_lambda_22_x_layer';
34+
export const COMMERCIAL_REGION_LAMBDA_JS_LAYER_RUNTIME: string = 'node_js_lambda_22_x_layer';
35+
export const GOV_CLOUD_REGION_LAMBDA_PYTHON_RUNTIME: lambda.Runtime = lambda.Runtime.PYTHON_3_11;
3636
export const COMMERCIAL_REGION_LAMBDA_JAVA_RUNTIME: lambda.Runtime = lambda.Runtime.JAVA_21;
3737
export const GOV_CLOUD_REGION_LAMBDA_JAVA_RUNTIME: lambda.Runtime = lambda.Runtime.JAVA_17;
3838
export const SERVICE_NAME = 'UseCaseManagement';
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env node
2+
/**********************************************************************************************************************
3+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. *
4+
* *
5+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance *
6+
* with the License. A copy of the License is located at *
7+
* *
8+
* http://www.apache.org/licenses/LICENSE-2.0 *
9+
* *
10+
* or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES *
11+
* OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions *
12+
* and limitations under the License. *
13+
*********************************************************************************************************************/
14+
15+
import * as cdk from 'aws-cdk-lib';
16+
import * as lambda from 'aws-cdk-lib/aws-lambda';
17+
import { NagSuppressions } from 'cdk-nag';
18+
import { IConstruct } from 'constructs';
19+
20+
/**
21+
* cdk-nag suppression class for lambda versioning
22+
*/
23+
export class LambdaVersionCDKNagSuppression implements cdk.IAspect {
24+
public visit(node: IConstruct): void {
25+
if (node instanceof lambda.Function) {
26+
if (node.runtime.toString().toLowerCase().includes('python3.12')) {
27+
NagSuppressions.addResourceSuppressions(node, [
28+
{
29+
id: 'AwsSolutions-L1',
30+
reason: 'The lambda function is using Python 3.12. Current version of the application is only tested until Python 3.12'
31+
}
32+
]);
33+
}
34+
}
35+
}
36+
}

0 commit comments

Comments
 (0)