Skip to content

Commit 0698e49

Browse files
author
Dinesh Sajwan
committed
feat(construct): merge with main
2 parents 098ceb2 + e61f9f0 commit 0698e49

File tree

56 files changed

+4337
-140
lines changed

Some content is hidden

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

56 files changed

+4337
-140
lines changed

.eslintrc.json

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.gitattributes

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.gitignore

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projen/deps.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projen/files.json

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projenrc.ts

+9-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {
2929
const GITHUB_USER = 'awslabs';
3030
const PUBLICATION_NAMESPACE = 'cdklabs';
3131
const PROJECT_NAME = 'generative-ai-cdk-constructs';
32-
const CDK_VERSION: string = '2.116.0';
32+
const CDK_VERSION: string = '2.122.0';
3333

3434
const project = new awscdk.AwsCdkConstructLibrary({
3535
author: 'Amazon Web Services - Prototyping and Cloud Engineering',
@@ -167,18 +167,24 @@ project.eslint?.addRules({
167167

168168
project.eslint?.addIgnorePattern('LangchainProps.ts');
169169
project.eslint?.addIgnorePattern('AdapterProps.ts');
170+
project.eslint?.addIgnorePattern('DockerLambdaCustomProps.ts');
170171

171172
// Shared interfaces extending pre-existing CDK interfaces
172-
new ProjenStruct(project, { name: 'LangchainProps', filePath: 'src/patterns/gen-ai/aws-langchain-common-layer/LangchainProps.ts' })
173+
new ProjenStruct(project, { name: 'LangchainProps', filePath: 'src/common/props/LangchainProps.ts' })
173174
.mixin(Struct.fromFqn('aws-cdk-lib.aws_lambda.LayerVersionProps'))
174175
.withoutDeprecated()
175176
.omit('code', 'compatibleRuntimes', 'compatibleArchitectures');
176177

177-
new ProjenStruct(project, { name: 'AdapterProps', filePath: 'src/patterns/gen-ai/aws-langchain-common-layer/AdapterProps.ts' })
178+
new ProjenStruct(project, { name: 'AdapterProps', filePath: 'src/common/props/AdapterProps.ts' })
178179
.mixin(Struct.fromFqn('aws-cdk-lib.aws_lambda.LayerVersionProps'))
179180
.withoutDeprecated()
180181
.omit('code');
181182

183+
new ProjenStruct(project, { name: 'DockerLambdaCustomProps', filePath: 'src/common/props/DockerLambdaCustomProps.ts' })
184+
.mixin(Struct.fromFqn('aws-cdk-lib.aws_lambda.DockerImageFunctionProps'))
185+
.withoutDeprecated()
186+
.omit('tracing', 'functionName', 'description', 'role', 'vpc', 'vpcSubnets', 'securityGroups', 'role', 'layers', 'allowPublicSubnet', 'allowAllOutbound');
187+
182188
const packageJson = project.tryFindObjectFile('package.json');
183189
packageJson?.patch(JsonPatch.add('/scripts/prepare', 'husky install')); // yarn 1
184190
packageJson?.patch(JsonPatch.add('/scripts/postinstall', 'husky install')); // yarn 2

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# CDK Generative AI Constructs V0.1.60 (2024-02-13)
2+
3+
Based on CDK library version 2.122.0
4+
15
# CDK Generative AI Constructs V0.1.35 (2024-01-24)
26

37
Based on CDK library version 2.116.0

DEVELOPER_GUIDE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Default output format [None]: json
1616
```
1717

1818
- [Node](https://nodejs.org/en) >= v20.9.0
19-
- [AWS CDK](https://github.com/aws/aws-cdk/releases/tag/v2.102.0) >= 2.114.0
19+
- [AWS CDK](https://github.com/aws/aws-cdk/releases/tag/v2.122.0) >= 2.122.0
2020
- [Python](https://www.python.org/downloads/) >=3.9
2121
- [Projen](https://github.com/projen/projen) >= 0.78.8
2222
- [Yarn](https://classic.yarnpkg.com/lang/en/docs/cli/install/) >= 1.22.19

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ The following constructs are available in the library:
8181
| [Amazon Bedrock](./src/cdk-lib/bedrock/README.md) | CDK L2 Constructs for Amazon Bedrock. | Amazon Bedrock, Amazon OpenSearch Serverless, AWS Lambda |
8282
| [Amazon OpenSearch Serverless Vector Collection](./src/cdk-lib/opensearchserverless/README.md) | CDK L2 Constructs to create a vector collection. | Amazon OpenSearch Vector Index |
8383
| [Amazon OpenSearch Vector Index](./src/cdk-lib/opensearch-vectorindex/README.md) | CDK L1 Custom Resource to create a vector index. | Amazon OpenSearch Serverless, AWS Lambda |
84+
| [Content Generation](./src/patterns/gen-ai/aws-contentgen-appsync-lambda/) | Generate images from text using Amazon titan-image-generator-v1 or stability.stable-diffusion-xl model. | AWS Lambda, Amazon Bedrock, AWS AppSync |
8485

8586
# Sample Use Cases
8687

@@ -95,6 +96,9 @@ The official samples repository https://github.com/aws-samples/generative-ai-cdk
9596
| [CDK Live! Building generative AI applications and architectures leveraging AWS CDK Constructs!](https://www.youtube.com/watch?v=NI1F4Xxqyr8) | CDK Live! episode focused on building and deploying generative AI applications and architectures on AWS using the AWS Cloud Development Kit (CDK) and the AWS Generative AI CDK Constructs. |
9697
| [Announcing AWS Generative AI CDK Constructs!](https://aws.amazon.com/blogs/devops/announcing-generative-ai-cdk-constructs/) | Blog post announcing the release of the AWS Generative AI CDK Constructs. |
9798
| [aws-genai-llm-chatbot](https://github.com/aws-samples/aws-genai-llm-chatbot/tree/main) | Multi-Model and Multi-RAG Powered Chatbot Using AWS CDK on AWS allowing you to experiment with a variety of Large Language Models and Multimodal Language Models, settings and prompts in your own AWS account. |
99+
| [amazon-bedrock-rag](https://github.com/aws-samples/amazon-bedrock-rag) | Fully managed RAG solution using Knowledge Bases for Amazon Bedrock. |
100+
| [Amazon Bedrock Knowledge Bases with Private Data](https://blog.serverlessadvocate.com/amazon-bedrock-knowledge-bases-with-private-data-7685d04ef396) | Blog post and associated code sample demonstrating how to integrate Knowledge Bases into Amazon Bedrock to provide foundational models with contextual data from private data sources. |
101+
| [Automating tasks using Amazon Bedrock Agents and AI](https://blog.serverlessadvocate.com/automating-tasks-using-amazon-bedrock-agents-and-ai-4b6fb8856589) | Blog post and associated code sample demonstrating how to deploy an Amazon Bedrock Agent and a Knowledge Base through a hotel and spa use case. |
98102

99103
# Operational Metrics Collection
100104

apidocs/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
### Classes
1414

1515
- [ContainerImage](classes/ContainerImage.md)
16+
- [ContentGenerationAppSyncLambda](classes/ContentGenerationAppSyncLambda.md)
1617
- [CustomSageMakerEndpoint](classes/CustomSageMakerEndpoint.md)
1718
- [DeepLearningContainerImage](classes/DeepLearningContainerImage.md)
1819
- [HuggingFaceSageMakerEndpoint](classes/HuggingFaceSageMakerEndpoint.md)
@@ -30,7 +31,9 @@
3031

3132
- [AdapterProps](interfaces/AdapterProps.md)
3233
- [ContainerImageConfig](interfaces/ContainerImageConfig.md)
34+
- [ContentGenerationAppSyncLambdaProps](interfaces/ContentGenerationAppSyncLambdaProps.md)
3335
- [CustomSageMakerEndpointProps](interfaces/CustomSageMakerEndpointProps.md)
36+
- [DockerLambdaCustomProps](interfaces/DockerLambdaCustomProps.md)
3437
- [HuggingFaceSageMakerEndpointProps](interfaces/HuggingFaceSageMakerEndpointProps.md)
3538
- [IInstanceAliase](interfaces/IInstanceAliase.md)
3639
- [IInstanceValiant](interfaces/IInstanceValiant.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
[@cdklabs/generative-ai-cdk-constructs](../README.md) / ContentGenerationAppSyncLambda
2+
3+
# Class: ContentGenerationAppSyncLambda
4+
5+
**`Summary`**
6+
7+
The ContentGenerationAppSyncLambda class.
8+
9+
## Hierarchy
10+
11+
- `Construct`
12+
13+
**`ContentGenerationAppSyncLambda`**
14+
15+
## Table of contents
16+
17+
### Constructors
18+
19+
- [constructor](ContentGenerationAppSyncLambda.md#constructor)
20+
21+
### Properties
22+
23+
- [cgLambdaFunction](ContentGenerationAppSyncLambda.md#cglambdafunction)
24+
- [generatedImageBus](ContentGenerationAppSyncLambda.md#generatedimagebus)
25+
- [graphqlApi](ContentGenerationAppSyncLambda.md#graphqlapi)
26+
- [node](ContentGenerationAppSyncLambda.md#node)
27+
- [s3GenerateAssetsBucket](ContentGenerationAppSyncLambda.md#s3generateassetsbucket)
28+
- [s3GenerateAssetsBucketInterface](ContentGenerationAppSyncLambda.md#s3generateassetsbucketinterface)
29+
- [securityGroup](ContentGenerationAppSyncLambda.md#securitygroup)
30+
- [vpc](ContentGenerationAppSyncLambda.md#vpc)
31+
32+
### Methods
33+
34+
- [toString](ContentGenerationAppSyncLambda.md#tostring)
35+
- [isConstruct](ContentGenerationAppSyncLambda.md#isconstruct)
36+
37+
## Constructors
38+
39+
### constructor
40+
41+
**new ContentGenerationAppSyncLambda**(`scope`, `id`, `props`): [`ContentGenerationAppSyncLambda`](ContentGenerationAppSyncLambda.md)
42+
43+
#### Parameters
44+
45+
| Name | Type | Description |
46+
| :------ | :------ | :------ |
47+
| `scope` | `Construct` | represents the scope for all the resources. |
48+
| `id` | `string` | this is a a scope-unique id. |
49+
| `props` | [`ContentGenerationAppSyncLambdaProps`](../interfaces/ContentGenerationAppSyncLambdaProps.md) | user provided props for the construct. |
50+
51+
#### Returns
52+
53+
[`ContentGenerationAppSyncLambda`](ContentGenerationAppSyncLambda.md)
54+
55+
**`Summary`**
56+
57+
Constructs a new instance of the ContentGenerationAppSyncLambda class.
58+
59+
**`Since`**
60+
61+
0.0.0
62+
63+
**`Access`**
64+
65+
public
66+
67+
#### Overrides
68+
69+
Construct.constructor
70+
71+
## Properties
72+
73+
### cgLambdaFunction
74+
75+
`Readonly` **cgLambdaFunction**: `DockerImageFunction`
76+
77+
Returns an instance of appsync.IGraphqlApi created by the construct
78+
79+
___
80+
81+
### generatedImageBus
82+
83+
`Readonly` **generatedImageBus**: `IEventBus`
84+
85+
Returns the instance of events.IEventBus used by the construct
86+
87+
___
88+
89+
### graphqlApi
90+
91+
`Readonly` **graphqlApi**: `IGraphqlApi`
92+
93+
Returns an instance of appsync.IGraphqlApi created by the construct
94+
95+
___
96+
97+
### node
98+
99+
`Readonly` **node**: `Node`
100+
101+
The tree node.
102+
103+
#### Inherited from
104+
105+
Construct.node
106+
107+
___
108+
109+
### s3GenerateAssetsBucket
110+
111+
`Optional` `Readonly` **s3GenerateAssetsBucket**: `Bucket`
112+
113+
Returns an instance of s3.Bucket created by the construct.
114+
IMPORTANT: If existingGeneratedAssetsBucketObj was provided in Pattern Construct Props,
115+
this property will be undefined
116+
117+
___
118+
119+
### s3GenerateAssetsBucketInterface
120+
121+
`Readonly` **s3GenerateAssetsBucketInterface**: `IBucket`
122+
123+
Returns an instance of s3.IBucket created by the construct
124+
125+
___
126+
127+
### securityGroup
128+
129+
`Readonly` **securityGroup**: `ISecurityGroup`
130+
131+
Returns the instance of ec2.ISecurityGroup used by the construct
132+
133+
___
134+
135+
### vpc
136+
137+
`Readonly` **vpc**: `IVpc`
138+
139+
Returns the instance of ec2.IVpc used by the construct
140+
141+
## Methods
142+
143+
### toString
144+
145+
**toString**(): `string`
146+
147+
Returns a string representation of this construct.
148+
149+
#### Returns
150+
151+
`string`
152+
153+
#### Inherited from
154+
155+
Construct.toString
156+
157+
___
158+
159+
### isConstruct
160+
161+
**isConstruct**(`x`): x is Construct
162+
163+
Checks if `x` is a construct.
164+
165+
Use this method instead of `instanceof` to properly detect `Construct`
166+
instances, even when the construct library is symlinked.
167+
168+
Explanation: in JavaScript, multiple copies of the `constructs` library on
169+
disk are seen as independent, completely different libraries. As a
170+
consequence, the class `Construct` in each copy of the `constructs` library
171+
is seen as a different class, and an instance of one class will not test as
172+
`instanceof` the other class. `npm install` will not create installations
173+
like this, but users may manually symlink construct libraries together or
174+
use a monorepo tool: in those cases, multiple copies of the `constructs`
175+
library can be accidentally installed, and `instanceof` will behave
176+
unpredictably. It is safest to avoid using `instanceof`, and using
177+
this type-testing method instead.
178+
179+
#### Parameters
180+
181+
| Name | Type | Description |
182+
| :------ | :------ | :------ |
183+
| `x` | `any` | Any object |
184+
185+
#### Returns
186+
187+
x is Construct
188+
189+
true if `x` is an object created from a class which extends `Construct`.
190+
191+
#### Inherited from
192+
193+
Construct.isConstruct

apidocs/classes/JumpStartSageMakerEndpoint.md

+7
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ The JumpStartSageMakerEndpoint class.
2020

2121
### Properties
2222

23+
- [acceptEula](JumpStartSageMakerEndpoint.md#accepteula)
2324
- [cfnEndpoint](JumpStartSageMakerEndpoint.md#cfnendpoint)
2425
- [cfnEndpointConfig](JumpStartSageMakerEndpoint.md#cfnendpointconfig)
2526
- [cfnModel](JumpStartSageMakerEndpoint.md#cfnmodel)
@@ -71,6 +72,12 @@ The JumpStartSageMakerEndpoint class.
7172

7273
## Properties
7374

75+
### acceptEula
76+
77+
`Private` `Readonly` **acceptEula**: `boolean`
78+
79+
___
80+
7481
### cfnEndpoint
7582

7683
`Readonly` **cfnEndpoint**: `CfnEndpoint`

apidocs/classes/QaAppsyncOpensearch.md

+9
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ The QaAppsyncOpensearch class.
2323
- [graphqlApi](QaAppsyncOpensearch.md#graphqlapi)
2424
- [node](QaAppsyncOpensearch.md#node)
2525
- [qaBus](QaAppsyncOpensearch.md#qabus)
26+
- [qaLambdaFunction](QaAppsyncOpensearch.md#qalambdafunction)
2627
- [s3InputAssetsBucket](QaAppsyncOpensearch.md#s3inputassetsbucket)
2728
- [s3InputAssetsBucketInterface](QaAppsyncOpensearch.md#s3inputassetsbucketinterface)
2829
- [securityGroup](QaAppsyncOpensearch.md#securitygroup)
@@ -97,6 +98,14 @@ Returns the instance of events.IEventBus used by the construct
9798

9899
___
99100

101+
### qaLambdaFunction
102+
103+
`Readonly` **qaLambdaFunction**: `DockerImageFunction`
104+
105+
Returns an instance of appsync.IGraphqlApi created by the construct
106+
107+
___
108+
100109
### s3InputAssetsBucket
101110

102111
`Optional` `Readonly` **s3InputAssetsBucket**: `Bucket`

0 commit comments

Comments
 (0)