Skip to content

Commit

Permalink
Dynamodb Streamのロールを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
mt-osho-san committed May 18, 2024
1 parent 1a2d837 commit 387fe3e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/backend/lib/constructs/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,15 @@ export class ApiStack extends Construct {
actions: ["ssm:GetParameter"],
resources: ["*"],
});
const dynamodbStreamPolicy = new cdk.aws_iam.PolicyStatement({
actions: [
"dynamodb:GetRecords",
"dynamodb:GetShardIterator",
"dynamodb:DescribeStream",
"dynamodb:ListStreams",
],
resources: [table.tableArn],
});
generativeAiLambdaRole.addToPolicy(ssmPolicy);

new ssm.StringParameter(this, "openai-api-key", {
Expand Down

0 comments on commit 387fe3e

Please sign in to comment.