File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
.tools/test/stacks/plugin/typescript Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change 210210 ) : void {
211211 // Add the SQS queue as an event source for the Lambda function.
212212 lambdaFunction . addEventSource ( new SqsEventSource ( sqsQueue ) ) ;
213+
213214 // Grant permissions to allow the function to receive messages from the queue.
214215 sqsQueue . grantConsumeMessages ( lambdaFunction ) ;
216+
215217 // Add IAM policy to the Lambda function's execution role to allow it to receive messages from the SQS queue.
216218 lambdaFunction . addToRolePolicy (
217219 new iam . PolicyStatement ( {
218220 actions : [ "sqs:ReceiveMessage" ] ,
219221 resources : [ sqsQueue . queueArn ] ,
220222 } ) ,
221223 ) ;
224+ // Additionally, ensure the Lambda function can create and write to CloudWatch Logs.
222225 lambdaFunction . addToRolePolicy (
223226 new iam . PolicyStatement ( {
224227 actions : [
You can’t perform that action at this time.
0 commit comments