Skip to content

Commit acc63c9

Browse files
authored
Merge pull request #260 from awslabs/feature/Issue-148-Image-generation
feat(construct): content generation construct
2 parents 92ebd97 + c517c3c commit acc63c9

File tree

15 files changed

+2700
-1
lines changed

15 files changed

+2700
-1
lines changed

README.md

+1
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

apidocs/README.md

+2
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,6 +31,7 @@
3031

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

0 commit comments

Comments
 (0)