Consume kinesis logs while task is RUNNING status
parent
6aec635bd4
commit
e036cd6b77
File diff suppressed because one or more lines are too long
|
|
@ -115,14 +115,20 @@ class AWS {
|
|||
return tasks.tasks[0].lastStatus;
|
||||
};
|
||||
|
||||
const stream = await kinesis
|
||||
.describeStream({
|
||||
StreamName: taskDefResources.StackResources.find(
|
||||
(x) => x.LogicalResourceId === 'KinesisStream',
|
||||
).PhysicalResourceId,
|
||||
})
|
||||
.promise();
|
||||
|
||||
while ((await getTaskStatus()) === 'RUNNING') {
|
||||
const iterator = await kinesis
|
||||
.getShardIterator({
|
||||
ShardIteratorType: 'TRIM_HORIZON',
|
||||
StreamName: taskDefResources.StackResources.find(
|
||||
(x) => x.LogicalResourceId === 'KinesisStream',
|
||||
).PhysicalResourceId,
|
||||
ShardId: 'example',
|
||||
StreamName: stream.StreamDescription.StreamName,
|
||||
ShardId: stream.StreamDescription.Shards[0].ShardId,
|
||||
})
|
||||
.promise();
|
||||
const records = await kinesis
|
||||
|
|
|
|||
Loading…
Reference in New Issue