Skip to content

Commit

Permalink
add check for timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
msambol committed Mar 28, 2024
1 parent f7c12af commit 50dbcec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-pipes-sources-alpha/lib/kinesis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export class KinesisSource implements ISource {
this.parallelizationFactor = this.sourceParameters.parallelizationFactor;
this.deadLetterTarget = this.sourceParameters.deadLetterTarget;
this.startingPosition = this.sourceParameters.startingPosition;
this.sourceParameters = this.sourceParameters.startingPositionTimestamp;
this.startingPositionTimestamp = this.sourceParameters.startingPositionTimestamp;

if (this.batchSize !== undefined) {
if (this.batchSize < 1 || this.batchSize > 10000) {
Expand Down
10 changes: 5 additions & 5 deletions packages/@aws-cdk/aws-pipes-sources-alpha/test/kinesis.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('kinesis source', () => {
maximumRetryAttempts: 10,
onPartialBatchItemFailure: OnPartialBatchItemFailure.AUTOMATIC_BISECT,
parallelizationFactor: 10,
startingPosition: KinesisStartingPosition.LATEST,
startingPosition: KinesisStartingPosition.AT_TIMESTAMP,
startingPositionTimestamp: '2024-01-01T00:00:00Z',
});

Expand Down Expand Up @@ -86,7 +86,7 @@ describe('kinesis source', () => {
MaximumRetryAttempts: 10,
OnPartialBatchItemFailure: 'AUTOMATIC_BISECT',
ParallelizationFactor: 10,
StartingPosition: 'LATEST',
StartingPosition: 'AT_TIMESTAMP',
StartingPositionTimestamp: '2024-01-01T00:00:00Z',
},
},
Expand All @@ -107,7 +107,7 @@ describe('kinesis source', () => {
maximumRetryAttempts: 10,
onPartialBatchItemFailure: OnPartialBatchItemFailure.AUTOMATIC_BISECT,
parallelizationFactor: 10,
startingPosition: KinesisStartingPosition.LATEST,
startingPosition: KinesisStartingPosition.AT_TIMESTAMP,
startingPositionTimestamp: '2024-01-01T00:00:00Z',
});

Expand Down Expand Up @@ -143,7 +143,7 @@ describe('kinesis source', () => {
MaximumRetryAttempts: 10,
OnPartialBatchItemFailure: 'AUTOMATIC_BISECT',
ParallelizationFactor: 10,
StartingPosition: 'LATEST',
StartingPosition: 'AT_TIMESTAMP',
StartingPositionTimestamp: '2024-01-01T00:00:00Z',
},
},
Expand Down Expand Up @@ -369,6 +369,6 @@ describe('kinesis source parameters validation', () => {
startingPosition: KinesisStartingPosition.LATEST,
startingPositionTimestamp: '2024-01-01T00:00:00Z',
});
}).toThrow('Timestamp only valid with StartingPosition AT_TIMESTAMP for Kinesis streams, received KinesisStartingPosition.LATEST');
}).toThrow('Timestamp only valid with StartingPosition AT_TIMESTAMP for Kinesis streams, received LATEST');
});
});

0 comments on commit 50dbcec

Please sign in to comment.