@@ -96,17 +96,12 @@ async function createAndExecute(
96
96
} ,
97
97
} ;
98
98
const accountId = ruleConfig . EventSourceArn . split ( ":" ) [ 4 ] ;
99
- sfTarget . InputTransformer . InputTemplate = `{\"OriginalEvent\": <OriginalEvent>, "StartTime": "${
100
- ruleConfig . EventStartTime
101
- } ", "TargetArn": "${
102
- sfTarget . Arn
103
- } ", "Action": "dispatch", "ReplaySpeed": ${
104
- cmd . replaySpeed || 0
105
- } , "DispatchSource": "${
106
- cmd . dispatchSourceOverride
107
- } ", "EventBusName": "${ cmd . eventbus } ", "ReplayName": "${
108
- cmd . replayName
109
- } "}`;
99
+ sfTarget . InputTransformer . InputTemplate = `{\"OriginalEvent\": <OriginalEvent>, "StartTime": "${ ruleConfig . EventStartTime
100
+ } ", "TargetArn": "${ sfTarget . Arn
101
+ } ", "Action": "dispatch", "ReplaySpeed": ${ cmd . replaySpeed || 0
102
+ } , "DispatchSource": "${ cmd . dispatchSourceOverride
103
+ } ", "EventBusName": "${ cmd . eventbus } ", "ReplayName": "${ cmd . replayName
104
+ } "}`;
110
105
sfTarget . Arn = `arn:aws:states:${ AWS . config . region } :${ accountId } :stateMachine:evb-cli-paced-replays` ;
111
106
sfRule . Name = `${ name } -sf` ;
112
107
delete sfRule . Arn ;
@@ -181,14 +176,20 @@ async function getDates() {
181
176
}
182
177
183
178
async function selectRules ( eventbus , rulePrefix ) {
184
- const rules = await eventBridge
185
- . listRules ( { EventBusName : eventbus , NamePrefix : rulePrefix } )
186
- . promise ( ) ;
179
+ const rules = [ ] ;
180
+ let token ;
181
+ do {
182
+ const ruleResponse = await eventBridge
183
+ . listRules ( { EventBusName : eventbus , NamePrefix : rulePrefix , NextToken : token } )
184
+ . promise ( ) ;
185
+ token = ruleResponse . NextToken ;
186
+ rules . push ( ...ruleResponse . Rules ) ;
187
+ } while ( token )
187
188
let filteredRules ;
188
189
189
190
do {
190
191
filteredRules = await inputUtil . multiSelectFrom (
191
- rules . Rules . filter ( ( p ) => ! p . ManagedBy ) . map ( ( p ) => {
192
+ rules . filter ( ( p ) => ! p . ManagedBy ) . map ( ( p ) => {
192
193
return { name : p . Name , value : p } ;
193
194
} ) ,
194
195
"Select rules to replay against" ,
0 commit comments