Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(construct): fixed bugs in image generation construct #338

Merged
merged 11 commits into from
Mar 22, 2024
2 changes: 1 addition & 1 deletion apidocs/classes/ContentGenerationAppSyncLambda.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ ___

### graphqlApi

• `Readonly` **graphqlApi**: `IGraphqlApi`
• `Readonly` **graphqlApi**: `GraphqlApi`

Returns an instance of appsync.IGraphqlApi created by the construct
dineshSajwan marked this conversation as resolved.
Show resolved Hide resolved

Expand Down
16 changes: 5 additions & 11 deletions src/patterns/gen-ai/aws-contentgen-appsync-lambda/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export class ContentGenerationAppSyncLambda extends BaseClass {
/**
* Returns an instance of appsync.IGraphqlApi created by the construct
dineshSajwan marked this conversation as resolved.
Show resolved Hide resolved
*/
public readonly graphqlApi: appsync.IGraphqlApi;
public readonly graphqlApi: appsync.GraphqlApi;
scottschreckengaust marked this conversation as resolved.
Show resolved Hide resolved
/**
* Returns an instance of appsync.IGraphqlApi created by the construct
dineshSajwan marked this conversation as resolved.
Show resolved Hide resolved
*/
Expand Down Expand Up @@ -412,12 +412,10 @@ export class ContentGenerationAppSyncLambda extends BaseClass {
generate_image_function_role.addToPolicy(
new iam.PolicyStatement({
effect: iam.Effect.ALLOW,
actions: ['s3:GetObject', 's3:GetObject*', 's3:GetBucket*', 's3:List*'],
actions: ['s3:GetObject', 's3:GetBucket', 's3:ListBucket', 's3:PutObject'],
resources: [
'arn:' + Aws.PARTITION + ':s3:::' + this.s3GenerateAssetsBucketInterface?.bucketName,
'arn:' + Aws.PARTITION + ':s3:::' +
this.s3GenerateAssetsBucketInterface?.bucketName +
'/*',
'arn:' + Aws.PARTITION + ':s3:::' + this.s3GenerateAssetsBucketInterface.bucketName + '/*',

],
}),
);
Expand All @@ -441,11 +439,7 @@ export class ContentGenerationAppSyncLambda extends BaseClass {
new iam.PolicyStatement({
effect: iam.Effect.ALLOW,
actions: [
'comprehend:DetectEntities',
'comprehend:DetectKeyPhrases',
'comprehend:DetectPiiEntities',
'comprehend:DetectSentiment',
'comprehend:DetectSyntax',
'comprehend:DetectToxicContent',
],
resources: ['*'],
}),
Expand Down