Skip to content

Commit

Permalink
Fix publish API error (#353)
Browse files Browse the repository at this point in the history
* Fix publish API error

* Fix conversation not found in publish API caused by permission error

Grant permission for sqs consumer handler to read the secret
  • Loading branch information
khchan123 authored Jun 13, 2024
1 parent 28a9aa6 commit 5cca49c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion cdk/bin/api-publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import "source-map-support/register";
import * as cdk from "aws-cdk-lib";
import { ApiPublishmentStack, VpcConfig } from "../lib/api-publishment-stack";
import * as apigateway from "aws-cdk-lib/aws-apigateway";
import { DbConfig } from "../lib/constructs/embedding";
import * as secretsmanager from "aws-cdk-lib/aws-secretsmanager";

const app = new cdk.App();
Expand Down
1 change: 1 addition & 0 deletions cdk/lib/api-publishment-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export class ApiPublishmentStack extends Stack {
role: handlerRole,
}
);
dbSecret.grantRead(sqsConsumeHandler);
sqsConsumeHandler.addEventSource(
new lambdaEventSources.SqsEventSource(chatQueue)
);
Expand Down

0 comments on commit 5cca49c

Please sign in to comment.