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;
|
return tasks.tasks[0].lastStatus;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const stream = await kinesis
|
||||||
|
.describeStream({
|
||||||
|
StreamName: taskDefResources.StackResources.find(
|
||||||
|
(x) => x.LogicalResourceId === 'KinesisStream',
|
||||||
|
).PhysicalResourceId,
|
||||||
|
})
|
||||||
|
.promise();
|
||||||
|
|
||||||
while ((await getTaskStatus()) === 'RUNNING') {
|
while ((await getTaskStatus()) === 'RUNNING') {
|
||||||
const iterator = await kinesis
|
const iterator = await kinesis
|
||||||
.getShardIterator({
|
.getShardIterator({
|
||||||
ShardIteratorType: 'TRIM_HORIZON',
|
ShardIteratorType: 'TRIM_HORIZON',
|
||||||
StreamName: taskDefResources.StackResources.find(
|
StreamName: stream.StreamDescription.StreamName,
|
||||||
(x) => x.LogicalResourceId === 'KinesisStream',
|
ShardId: stream.StreamDescription.Shards[0].ShardId,
|
||||||
).PhysicalResourceId,
|
|
||||||
ShardId: 'example',
|
|
||||||
})
|
})
|
||||||
.promise();
|
.promise();
|
||||||
const records = await kinesis
|
const records = await kinesis
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue