@@ -10,21 +10,12 @@ export interface KinesisTargetParameters {
10
10
* The input transformation to apply to the message before sending it to the target.
11
11
*
12
12
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipetargetparameters.html#cfn-pipes-pipe-pipetargetparameters-inputtemplate
13
- * @default none
13
+ * @default - none
14
14
*/
15
15
readonly inputTransformation ?: IInputTransformation ;
16
16
17
17
/**
18
- * Determines which shard in the stream the data record is assigned to. Partition keys are
19
- * Unicode strings with a maximum length limit of 256 characters for each key. Amazon Kinesis
20
- * Data Streams uses the partition key as input to a hash function that maps the partition key
21
- * and associated data to a specific shard. Specifically, an MD5 hash function is used to map
22
- * partition keys to 128-bit integer values and to map associated data records to shards. As a
23
- * result of this hashing mechanism, all data records with the same partition key map to the
24
- * same shard within the stream.
25
- *
26
- * Minimum: 0
27
- * Maximum: 256
18
+ * Determines which shard in the stream the data record is assigned to.
28
19
*
29
20
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipetargetkinesisstreamparameters.html#cfn-pipes-pipe-pipetargetkinesisstreamparameters-partitionkey
30
21
*/
@@ -46,9 +37,11 @@ export class KinesisTarget implements ITarget {
46
37
47
38
validatePartitionKey ( parameters . partitionKey ) ;
48
39
}
40
+
49
41
grantPush ( grantee : IRole ) : void {
50
42
this . stream . grantWrite ( grantee ) ;
51
43
}
44
+
52
45
bind ( pipe : IPipe ) : TargetConfig {
53
46
if ( ! this . streamParameters ) {
54
47
return {
@@ -66,7 +59,7 @@ export class KinesisTarget implements ITarget {
66
59
}
67
60
68
61
function validatePartitionKey ( pk : string ) {
69
- if ( pk . length < 0 || pk . length > 256 ) {
70
- throw new Error ( `Partition key must be between 0 and 256 characters, received ${ pk . length } ` ) ;
62
+ if ( pk . length > 256 ) {
63
+ throw new Error ( `Partition key must be less than or equal to 256 characters, received ${ pk . length } ` ) ;
71
64
}
72
65
}
0 commit comments