Skip to content

Commit 4696f73

Browse files
authored
Upgrade to version v1.4.2
Upgrade to version v1.4.2
2 parents c7a1dc2 + 0411d70 commit 4696f73

File tree

86 files changed

+702
-524
lines changed

Some content is hidden

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

86 files changed

+702
-524
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ 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+
## [1.4.2] - 2024-05-16
9+
10+
### Changed
11+
12+
- Switched to using `langchain-aws` library for Bedrock and SageMaker LangChain calls instead of `langchain-community`.
13+
14+
815
## [1.4.1] - 2024-05-07
916

1017
### Security

NOTICE.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ jsonpatch BSD License
123123
jsonpath-ng Apache2.0
124124
jsonpointer BSD License
125125
langchain MIT
126+
langchain-aws MIT
126127
langchain-community MIT
127128
langchain-core MIT
128129
langchain-text-splitters MIT

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## Generative AI Application Builder on AWS
22

3+
4+
> **_NOTE:_** If you want to use the solution without any custom changes, navigate to [Solution Landing Page](https://aws.amazon.com/solutions/implementations/generative-ai-application-builder-on-aws/) and click the "Launch in the AWS Console" in the Deployment options for a 1-click deployment into your AWS Console.
5+
36
The [Generative AI Application Builder on AWS](https://aws.amazon.com/solutions/implementations/generative-ai-application-builder-on-aws/) solution (GAAB) provides a web-based management dashboard to deploy customizable Generative AI (Gen AI) use cases. This Deployment dashboard allows customers to deploy, experiment with, and compare different combinations of Large Language Model (LLM) use cases. Once customers have successfully configured and optimized their use case, they can take their deployment into production and integrate it within their applications.
47

58
The Generative AI Application Builder is published under an Apache 2.0 license and is targeted for novice to experienced users who want to experiment and productionize different Gen AI use cases. The solution uses [LangChain](https://www.langchain.com/) open-source software (OSS) to configure connections to your choice of Large Language Models (LLMs) for different use cases. The first release of GAAB allows users to deploy chat use cases which allow the ability to query over users' enterprise data in a chatbot-style User Interface (UI), along with an API to support custom end-user implementations.

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 v1.4.1 template-bucket-name"
43+
echo "For example: ./build-s3-dist.sh solutions trademarked-solution-name v1.4.2 template-bucket-name"
4444
exit 1
4545
fi
4646

source/infrastructure/cdk.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"@aws-cdk/aws-codepipeline-actions:useNewDefaultBranchForCodeCommitSource": true,
5858
"solution_id": "SO0276",
5959
"solution_name": "generative-ai-application-builder-on-aws",
60-
"solution_version": "v1.4.1",
60+
"solution_version": "v1.4.2",
6161
"app_registry_name": "GAAB",
6262
"application_type": "AWS-Solutions",
6363
"application_trademark_name": "Generative AI Application Builder on AWS"

source/infrastructure/lib/bedrock-chat-stack.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,13 @@ export class BedrockChat extends UseCaseChat {
9494
})
9595
);
9696

97+
this.chatLlmProviderLambda.addToRolePolicy(
98+
new cdk.aws_iam.PolicyStatement({
99+
actions: ['bedrock:ApplyGuardrail'],
100+
resources: [`arn:${cdk.Aws.PARTITION}:bedrock:${cdk.Aws.REGION}:${cdk.Aws.ACCOUNT_ID}:guardrail/*`]
101+
})
102+
);
103+
97104
NagSuppressions.addResourceSuppressions(
98105
this.chatLlmProviderLambda.role!.node.tryFindChild('DefaultPolicy') as iam.Policy,
99106
[
@@ -102,6 +109,7 @@ export class BedrockChat extends UseCaseChat {
102109
reason: 'This lambda is granted permissions to invoke any bedrock model, which requires the *.',
103110
appliesTo: [
104111
'Resource::arn:<AWS::Partition>:bedrock:<AWS::Region>::foundation-model/*',
112+
'Resource::arn:<AWS::Partition>:bedrock:<AWS::Region>:<AWS::AccountId>:guardrail/*',
105113
'Resource::*'
106114
]
107115
}

source/infrastructure/lib/vpc/bedrock-vpc.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ export class BedrockUseCaseVPC extends FirstPartyUseCaseVPC {
4040
resources: [`arn:${cdk.Aws.PARTITION}:bedrock:${cdk.Aws.REGION}::foundation-model/*`]
4141
})
4242
);
43+
44+
bedrockEndpoint.addToPolicy(
45+
new iam.PolicyStatement({
46+
principals: [new iam.AnyPrincipal()], // NOSONAR - policy is on vpc endpoint, user principal is not known - typescript:S6270
47+
actions: ['bedrock:ApplyGuardrail'],
48+
effect: iam.Effect.ALLOW, // NOSONAR - typescript:S6270, creating an allow policy for specific actions
49+
resources: [`arn:${cdk.Aws.PARTITION}:bedrock:${cdk.Aws.REGION}:${cdk.Aws.ACCOUNT_ID}:guardrail/*`]
50+
})
51+
);
4352
}
4453

4554
/**

source/infrastructure/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/infrastructure/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gen-ai-app-builder-on-aws-infrastructure",
3-
"version": "1.4.1",
3+
"version": "1.4.2",
44
"bin": {
55
"infrastructure": "bin/gen-ai-app-builder.js"
66
},

source/infrastructure/test/bedrock-chat-stack.test.ts

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ describe('When Chat use case is created', () => {
8484
});
8585
});
8686

87-
it('should create chat provider lambda function with permissions to invoke the bedrock APIs', () => {
87+
it('should create chat provider lambda function with permissions to call the Bedrock Invoke APIs', () => {
8888
template.hasResourceProperties('AWS::IAM::Policy', {
8989
'PolicyDocument': {
9090
'Statement': [
@@ -111,6 +111,46 @@ describe('When Chat use case is created', () => {
111111
Match.anyValue(),
112112
Match.anyValue(),
113113
Match.anyValue(),
114+
Match.anyValue(),
115+
Match.anyValue()
116+
],
117+
'Version': '2012-10-17'
118+
}
119+
});
120+
});
121+
122+
it('should create chat provider lambda function with permissions to apply Bedrock Guardrails', () => {
123+
template.hasResourceProperties('AWS::IAM::Policy', {
124+
'PolicyDocument': {
125+
'Statement': [
126+
Match.anyValue(),
127+
{
128+
'Action': 'bedrock:ApplyGuardrail',
129+
'Effect': 'Allow',
130+
'Resource': {
131+
'Fn::Join': [
132+
'',
133+
[
134+
'arn:',
135+
{
136+
'Ref': 'AWS::Partition'
137+
},
138+
':bedrock:',
139+
{
140+
'Ref': 'AWS::Region'
141+
},
142+
':',
143+
{
144+
'Ref': 'AWS::AccountId'
145+
},
146+
':guardrail/*'
147+
]
148+
]
149+
}
150+
},
151+
Match.anyValue(),
152+
Match.anyValue(),
153+
Match.anyValue(),
114154
Match.anyValue()
115155
],
116156
'Version': '2012-10-17'

0 commit comments

Comments
 (0)