File tree Expand file tree Collapse file tree 2 files changed +22
-6
lines changed
infrastructure/terraform/components/dl
utils/utils/src/event-publish Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -87,4 +87,17 @@ data "aws_iam_policy_document" "ttl_create_lambda" {
8787 module . sqs_ttl . sqs_queue_arn ,
8888 ]
8989 }
90+
91+ statement {
92+ sid = " PutEvents"
93+ effect = " Allow"
94+
95+ actions = [
96+ " events:PutEvents" ,
97+ ]
98+
99+ resources = [
100+ aws_cloudwatch_event_bus . main . arn ,
101+ ]
102+ }
90103}
Original file line number Diff line number Diff line change @@ -55,14 +55,15 @@ export class EventPublisher {
5555 eventBusArn : this . config . eventBusArn ,
5656 batchSize : batch . length ,
5757 } ) ;
58- const entries = batch . map ( ( event ) => ( {
59- Source : 'custom.event' ,
60- DetailType : event . type ,
61- Detail : JSON . stringify ( event ) ,
62- EventBusName : this . config . eventBusArn ,
63- } ) ) ;
6458
6559 try {
60+ const entries = batch . map ( ( event ) => ( {
61+ Source : 'custom.event' ,
62+ DetailType : event . type ,
63+ Detail : JSON . stringify ( event ) ,
64+ EventBusName : this . config . eventBusArn ,
65+ } ) ) ;
66+
6667 const response = await this . eventBridge . send (
6768 new PutEventsCommand ( { Entries : entries } ) ,
6869 ) ;
@@ -123,6 +124,8 @@ export class EventPublisher {
123124 } ) ,
124125 ) ;
125126
127+ this . logger . debug ( { response} ) ;
128+
126129 if ( response . Failed )
127130 for ( const failedEntry of response . Failed ) {
128131 const failedEvent =
You can’t perform that action at this time.
0 commit comments