Skip to content

Commit

Permalink
Add feedback from Leonardo
Browse files Browse the repository at this point in the history
  • Loading branch information
msambol committed Oct 3, 2024
1 parent 7968edc commit b1df332
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions packages/@aws-cdk/aws-pipes-targets-alpha/lib/kinesis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface KinesisTargetParameters {
}

/**
* A EventBridge Pipes target that sends messages to a Kinesis stream.
* An EventBridge Pipes target that sends messages to a Kinesis stream.
*/
export class KinesisTarget implements ITarget {
private stream: IStream;
Expand All @@ -44,12 +44,6 @@ export class KinesisTarget implements ITarget {
}

bind(pipe: IPipe): TargetConfig {
if (!this.streamParameters) {
return {
targetParameters: {},
};
}

return {
targetParameters: {
inputTemplate: this.streamParameters.inputTransformation?.bind(pipe).inputTemplate,
Expand All @@ -60,9 +54,7 @@ export class KinesisTarget implements ITarget {
}

function validatePartitionKey(pk: string) {
if (!Token.isUnresolved(pk)) {
if (pk.length > 256) {
throw new Error(`Partition key must be less than or equal to 256 characters, received ${pk.length}`);
}
if (!Token.isUnresolved(pk) && pk.length > 256) {
throw new Error(`Partition key must be less than or equal to 256 characters, received ${pk.length}`);
}
}

0 comments on commit b1df332

Please sign in to comment.