Skip to content

Commit b1df332

Browse files
committed
Add feedback from Leonardo
1 parent 7968edc commit b1df332

File tree

1 file changed

+3
-11
lines changed
  • packages/@aws-cdk/aws-pipes-targets-alpha/lib

1 file changed

+3
-11
lines changed

packages/@aws-cdk/aws-pipes-targets-alpha/lib/kinesis.ts

+3-11
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export interface KinesisTargetParameters {
2424
}
2525

2626
/**
27-
* A EventBridge Pipes target that sends messages to a Kinesis stream.
27+
* An EventBridge Pipes target that sends messages to a Kinesis stream.
2828
*/
2929
export class KinesisTarget implements ITarget {
3030
private stream: IStream;
@@ -44,12 +44,6 @@ export class KinesisTarget implements ITarget {
4444
}
4545

4646
bind(pipe: IPipe): TargetConfig {
47-
if (!this.streamParameters) {
48-
return {
49-
targetParameters: {},
50-
};
51-
}
52-
5347
return {
5448
targetParameters: {
5549
inputTemplate: this.streamParameters.inputTransformation?.bind(pipe).inputTemplate,
@@ -60,9 +54,7 @@ export class KinesisTarget implements ITarget {
6054
}
6155

6256
function validatePartitionKey(pk: string) {
63-
if (!Token.isUnresolved(pk)) {
64-
if (pk.length > 256) {
65-
throw new Error(`Partition key must be less than or equal to 256 characters, received ${pk.length}`);
66-
}
57+
if (!Token.isUnresolved(pk) && pk.length > 256) {
58+
throw new Error(`Partition key must be less than or equal to 256 characters, received ${pk.length}`);
6759
}
6860
}

0 commit comments

Comments
 (0)