/
awskinesisfirehosedestinations.go
688 lines (656 loc) · 25.5 KB
/
awskinesisfirehosedestinations.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
package awskinesisfirehosedestinations
import (
_init_ "github.com/aws/aws-cdk-go/awscdk/jsii"
_jsii_ "github.com/aws/jsii-runtime-go/runtime"
"github.com/aws/aws-cdk-go/awscdk"
"github.com/aws/aws-cdk-go/awscdk/awsiam"
"github.com/aws/aws-cdk-go/awscdk/awskinesisfirehose"
"github.com/aws/aws-cdk-go/awscdk/awskinesisfirehosedestinations/internal"
"github.com/aws/aws-cdk-go/awscdk/awskms"
"github.com/aws/aws-cdk-go/awscdk/awslogs"
"github.com/aws/aws-cdk-go/awscdk/awss3"
"github.com/aws/constructs-go/constructs/v3"
)
// Options for S3 record backup of a delivery stream.
//
// Example:
// import path "github.com/aws-samples/dummy/path"
// import firehose "github.com/aws/aws-cdk-go/awscdk"
// import kms "github.com/aws/aws-cdk-go/awscdk"
// import lambdanodejs "github.com/aws/aws-cdk-go/awscdk"
// import logs "github.com/aws/aws-cdk-go/awscdk"
// import s3 "github.com/aws/aws-cdk-go/awscdk"
// import cdk "github.com/aws/aws-cdk-go/awscdk"
// import destinations "github.com/aws/aws-cdk-go/awscdk"
//
// app := cdk.NewApp()
//
// stack := cdk.NewStack(app, jsii.String("aws-cdk-firehose-delivery-stream-s3-all-properties"))
//
// bucket := s3.NewBucket(stack, jsii.String("Bucket"), &bucketProps{
// removalPolicy: cdk.removalPolicy_DESTROY,
// autoDeleteObjects: jsii.Boolean(true),
// })
//
// backupBucket := s3.NewBucket(stack, jsii.String("BackupBucket"), &bucketProps{
// removalPolicy: cdk.*removalPolicy_DESTROY,
// autoDeleteObjects: jsii.Boolean(true),
// })
// logGroup := logs.NewLogGroup(stack, jsii.String("LogGroup"), &logGroupProps{
// removalPolicy: cdk.*removalPolicy_DESTROY,
// })
//
// dataProcessorFunction := lambdanodejs.NewNodejsFunction(stack, jsii.String("DataProcessorFunction"), &nodejsFunctionProps{
// entry: path.join(__dirname, jsii.String("lambda-data-processor.js")),
// timeout: cdk.duration.minutes(jsii.Number(1)),
// })
//
// processor := firehose.NewLambdaFunctionProcessor(dataProcessorFunction, &dataProcessorProps{
// bufferInterval: cdk.*duration.seconds(jsii.Number(60)),
// bufferSize: cdk.size.mebibytes(jsii.Number(1)),
// retries: jsii.Number(1),
// })
//
// key := kms.NewKey(stack, jsii.String("Key"), &keyProps{
// removalPolicy: cdk.*removalPolicy_DESTROY,
// })
//
// backupKey := kms.NewKey(stack, jsii.String("BackupKey"), &keyProps{
// removalPolicy: cdk.*removalPolicy_DESTROY,
// })
//
// firehose.NewDeliveryStream(stack, jsii.String("Delivery Stream"), &deliveryStreamProps{
// destinations: []iDestination{
// destinations.NewS3Bucket(bucket, &s3BucketProps{
// logging: jsii.Boolean(true),
// logGroup: logGroup,
// processor: processor,
// compression: destinations.compression_GZIP(),
// dataOutputPrefix: jsii.String("regularPrefix"),
// errorOutputPrefix: jsii.String("errorPrefix"),
// bufferingInterval: cdk.*duration.seconds(jsii.Number(60)),
// bufferingSize: cdk.*size.mebibytes(jsii.Number(1)),
// encryptionKey: key,
// s3Backup: &destinationS3BackupProps{
// mode: destinations.backupMode_ALL,
// bucket: backupBucket,
// compression: destinations.*compression_ZIP(),
// dataOutputPrefix: jsii.String("backupPrefix"),
// errorOutputPrefix: jsii.String("backupErrorPrefix"),
// bufferingInterval: cdk.*duration.seconds(jsii.Number(60)),
// bufferingSize: cdk.*size.mebibytes(jsii.Number(1)),
// encryptionKey: backupKey,
// },
// }),
// },
// })
//
// app.synth()
//
// Experimental.
type BackupMode string
const (
// All records are backed up.
// Experimental.
BackupMode_ALL BackupMode = "ALL"
// Only records that failed to deliver or transform are backed up.
// Experimental.
BackupMode_FAILED BackupMode = "FAILED"
)
// Generic properties for defining a delivery stream destination.
//
// Example:
// // The code below shows an example of how to instantiate this type.
// // The values are placeholders you should change.
// import monocdk "github.com/aws/aws-cdk-go/awscdk"
// import "github.com/aws/aws-cdk-go/awscdk"
// import "github.com/aws/aws-cdk-go/awscdk"
// import "github.com/aws/aws-cdk-go/awscdk"
// import "github.com/aws/aws-cdk-go/awscdk"
// import "github.com/aws/aws-cdk-go/awscdk"
// import "github.com/aws/aws-cdk-go/awscdk"
//
// var bucket bucket
// var compression compression
// var dataProcessor iDataProcessor
// var duration duration
// var key key
// var logGroup logGroup
// var role role
// var size size
//
// commonDestinationProps := &commonDestinationProps{
// logging: jsii.Boolean(false),
// logGroup: logGroup,
// processor: dataProcessor,
// role: role,
// s3Backup: &destinationS3BackupProps{
// bucket: bucket,
// bufferingInterval: duration,
// bufferingSize: size,
// compression: compression,
// dataOutputPrefix: jsii.String("dataOutputPrefix"),
// encryptionKey: key,
// errorOutputPrefix: jsii.String("errorOutputPrefix"),
// logging: jsii.Boolean(false),
// logGroup: logGroup,
// mode: awscdk.Aws_kinesisfirehose_destinations.backupMode_ALL,
// },
// }
//
// Experimental.
type CommonDestinationProps struct {
// If true, log errors when data transformation or data delivery fails.
//
// If `logGroup` is provided, this will be implicitly set to `true`.
// Experimental.
Logging *bool `field:"optional" json:"logging" yaml:"logging"`
// The CloudWatch log group where log streams will be created to hold error logs.
// Experimental.
LogGroup awslogs.ILogGroup `field:"optional" json:"logGroup" yaml:"logGroup"`
// The data transformation that should be performed on the data before writing to the destination.
// Experimental.
Processor awskinesisfirehose.IDataProcessor `field:"optional" json:"processor" yaml:"processor"`
// The IAM role associated with this destination.
//
// Assumed by Kinesis Data Firehose to invoke processors and write to destinations.
// Experimental.
Role awsiam.IRole `field:"optional" json:"role" yaml:"role"`
// The configuration for backing up source records to S3.
// Experimental.
S3Backup *DestinationS3BackupProps `field:"optional" json:"s3Backup" yaml:"s3Backup"`
}
// Common properties for defining a backup, intermediary, or final S3 destination for a Kinesis Data Firehose delivery stream.
//
// Example:
// // The code below shows an example of how to instantiate this type.
// // The values are placeholders you should change.
// import monocdk "github.com/aws/aws-cdk-go/awscdk"
// import "github.com/aws/aws-cdk-go/awscdk"
// import "github.com/aws/aws-cdk-go/awscdk"
//
// var compression compression
// var duration duration
// var key key
// var size size
//
// commonDestinationS3Props := &commonDestinationS3Props{
// bufferingInterval: duration,
// bufferingSize: size,
// compression: compression,
// dataOutputPrefix: jsii.String("dataOutputPrefix"),
// encryptionKey: key,
// errorOutputPrefix: jsii.String("errorOutputPrefix"),
// }
//
// Experimental.
type CommonDestinationS3Props struct {
// The length of time that Firehose buffers incoming data before delivering it to the S3 bucket.
//
// Minimum: Duration.seconds(60)
// Maximum: Duration.seconds(900)
// Experimental.
BufferingInterval awscdk.Duration `field:"optional" json:"bufferingInterval" yaml:"bufferingInterval"`
// The size of the buffer that Kinesis Data Firehose uses for incoming data before delivering it to the S3 bucket.
//
// Minimum: Size.mebibytes(1)
// Maximum: Size.mebibytes(128)
// Experimental.
BufferingSize awscdk.Size `field:"optional" json:"bufferingSize" yaml:"bufferingSize"`
// The type of compression that Kinesis Data Firehose uses to compress the data that it delivers to the Amazon S3 bucket.
//
// The compression formats SNAPPY or ZIP cannot be specified for Amazon Redshift
// destinations because they are not supported by the Amazon Redshift COPY operation
// that reads from the S3 bucket.
// Experimental.
Compression Compression `field:"optional" json:"compression" yaml:"compression"`
// A prefix that Kinesis Data Firehose evaluates and adds to records before writing them to S3.
//
// This prefix appears immediately following the bucket name.
// See: https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html
//
// Experimental.
DataOutputPrefix *string `field:"optional" json:"dataOutputPrefix" yaml:"dataOutputPrefix"`
// The AWS KMS key used to encrypt the data that it delivers to your Amazon S3 bucket.
// Experimental.
EncryptionKey awskms.IKey `field:"optional" json:"encryptionKey" yaml:"encryptionKey"`
// A prefix that Kinesis Data Firehose evaluates and adds to failed records before writing them to S3.
//
// This prefix appears immediately following the bucket name.
// See: https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html
//
// Experimental.
ErrorOutputPrefix *string `field:"optional" json:"errorOutputPrefix" yaml:"errorOutputPrefix"`
}
// Possible compression options Kinesis Data Firehose can use to compress data on delivery.
//
// Example:
// import path "github.com/aws-samples/dummy/path"
// import firehose "github.com/aws/aws-cdk-go/awscdk"
// import kms "github.com/aws/aws-cdk-go/awscdk"
// import lambdanodejs "github.com/aws/aws-cdk-go/awscdk"
// import logs "github.com/aws/aws-cdk-go/awscdk"
// import s3 "github.com/aws/aws-cdk-go/awscdk"
// import cdk "github.com/aws/aws-cdk-go/awscdk"
// import destinations "github.com/aws/aws-cdk-go/awscdk"
//
// app := cdk.NewApp()
//
// stack := cdk.NewStack(app, jsii.String("aws-cdk-firehose-delivery-stream-s3-all-properties"))
//
// bucket := s3.NewBucket(stack, jsii.String("Bucket"), &bucketProps{
// removalPolicy: cdk.removalPolicy_DESTROY,
// autoDeleteObjects: jsii.Boolean(true),
// })
//
// backupBucket := s3.NewBucket(stack, jsii.String("BackupBucket"), &bucketProps{
// removalPolicy: cdk.*removalPolicy_DESTROY,
// autoDeleteObjects: jsii.Boolean(true),
// })
// logGroup := logs.NewLogGroup(stack, jsii.String("LogGroup"), &logGroupProps{
// removalPolicy: cdk.*removalPolicy_DESTROY,
// })
//
// dataProcessorFunction := lambdanodejs.NewNodejsFunction(stack, jsii.String("DataProcessorFunction"), &nodejsFunctionProps{
// entry: path.join(__dirname, jsii.String("lambda-data-processor.js")),
// timeout: cdk.duration.minutes(jsii.Number(1)),
// })
//
// processor := firehose.NewLambdaFunctionProcessor(dataProcessorFunction, &dataProcessorProps{
// bufferInterval: cdk.*duration.seconds(jsii.Number(60)),
// bufferSize: cdk.size.mebibytes(jsii.Number(1)),
// retries: jsii.Number(1),
// })
//
// key := kms.NewKey(stack, jsii.String("Key"), &keyProps{
// removalPolicy: cdk.*removalPolicy_DESTROY,
// })
//
// backupKey := kms.NewKey(stack, jsii.String("BackupKey"), &keyProps{
// removalPolicy: cdk.*removalPolicy_DESTROY,
// })
//
// firehose.NewDeliveryStream(stack, jsii.String("Delivery Stream"), &deliveryStreamProps{
// destinations: []iDestination{
// destinations.NewS3Bucket(bucket, &s3BucketProps{
// logging: jsii.Boolean(true),
// logGroup: logGroup,
// processor: processor,
// compression: destinations.compression_GZIP(),
// dataOutputPrefix: jsii.String("regularPrefix"),
// errorOutputPrefix: jsii.String("errorPrefix"),
// bufferingInterval: cdk.*duration.seconds(jsii.Number(60)),
// bufferingSize: cdk.*size.mebibytes(jsii.Number(1)),
// encryptionKey: key,
// s3Backup: &destinationS3BackupProps{
// mode: destinations.backupMode_ALL,
// bucket: backupBucket,
// compression: destinations.*compression_ZIP(),
// dataOutputPrefix: jsii.String("backupPrefix"),
// errorOutputPrefix: jsii.String("backupErrorPrefix"),
// bufferingInterval: cdk.*duration.seconds(jsii.Number(60)),
// bufferingSize: cdk.*size.mebibytes(jsii.Number(1)),
// encryptionKey: backupKey,
// },
// }),
// },
// })
//
// app.synth()
//
// Experimental.
type Compression interface {
// the string value of the Compression.
// Experimental.
Value() *string
}
// The jsii proxy struct for Compression
type jsiiProxy_Compression struct {
_ byte // padding
}
func (j *jsiiProxy_Compression) Value() *string {
var returns *string
_jsii_.Get(
j,
"value",
&returns,
)
return returns
}
// Creates a new Compression instance with a custom value.
// Experimental.
func Compression_Of(value *string) Compression {
_init_.Initialize()
var returns Compression
_jsii_.StaticInvoke(
"monocdk.aws_kinesisfirehose_destinations.Compression",
"of",
[]interface{}{value},
&returns,
)
return returns
}
func Compression_GZIP() Compression {
_init_.Initialize()
var returns Compression
_jsii_.StaticGet(
"monocdk.aws_kinesisfirehose_destinations.Compression",
"GZIP",
&returns,
)
return returns
}
func Compression_HADOOP_SNAPPY() Compression {
_init_.Initialize()
var returns Compression
_jsii_.StaticGet(
"monocdk.aws_kinesisfirehose_destinations.Compression",
"HADOOP_SNAPPY",
&returns,
)
return returns
}
func Compression_SNAPPY() Compression {
_init_.Initialize()
var returns Compression
_jsii_.StaticGet(
"monocdk.aws_kinesisfirehose_destinations.Compression",
"SNAPPY",
&returns,
)
return returns
}
func Compression_ZIP() Compression {
_init_.Initialize()
var returns Compression
_jsii_.StaticGet(
"monocdk.aws_kinesisfirehose_destinations.Compression",
"ZIP",
&returns,
)
return returns
}
// Properties for defining an S3 backup destination.
//
// S3 backup is available for all destinations, regardless of whether the final destination is S3 or not.
//
// Example:
// import path "github.com/aws-samples/dummy/path"
// import firehose "github.com/aws/aws-cdk-go/awscdk"
// import kms "github.com/aws/aws-cdk-go/awscdk"
// import lambdanodejs "github.com/aws/aws-cdk-go/awscdk"
// import logs "github.com/aws/aws-cdk-go/awscdk"
// import s3 "github.com/aws/aws-cdk-go/awscdk"
// import cdk "github.com/aws/aws-cdk-go/awscdk"
// import destinations "github.com/aws/aws-cdk-go/awscdk"
//
// app := cdk.NewApp()
//
// stack := cdk.NewStack(app, jsii.String("aws-cdk-firehose-delivery-stream-s3-all-properties"))
//
// bucket := s3.NewBucket(stack, jsii.String("Bucket"), &bucketProps{
// removalPolicy: cdk.removalPolicy_DESTROY,
// autoDeleteObjects: jsii.Boolean(true),
// })
//
// backupBucket := s3.NewBucket(stack, jsii.String("BackupBucket"), &bucketProps{
// removalPolicy: cdk.*removalPolicy_DESTROY,
// autoDeleteObjects: jsii.Boolean(true),
// })
// logGroup := logs.NewLogGroup(stack, jsii.String("LogGroup"), &logGroupProps{
// removalPolicy: cdk.*removalPolicy_DESTROY,
// })
//
// dataProcessorFunction := lambdanodejs.NewNodejsFunction(stack, jsii.String("DataProcessorFunction"), &nodejsFunctionProps{
// entry: path.join(__dirname, jsii.String("lambda-data-processor.js")),
// timeout: cdk.duration.minutes(jsii.Number(1)),
// })
//
// processor := firehose.NewLambdaFunctionProcessor(dataProcessorFunction, &dataProcessorProps{
// bufferInterval: cdk.*duration.seconds(jsii.Number(60)),
// bufferSize: cdk.size.mebibytes(jsii.Number(1)),
// retries: jsii.Number(1),
// })
//
// key := kms.NewKey(stack, jsii.String("Key"), &keyProps{
// removalPolicy: cdk.*removalPolicy_DESTROY,
// })
//
// backupKey := kms.NewKey(stack, jsii.String("BackupKey"), &keyProps{
// removalPolicy: cdk.*removalPolicy_DESTROY,
// })
//
// firehose.NewDeliveryStream(stack, jsii.String("Delivery Stream"), &deliveryStreamProps{
// destinations: []iDestination{
// destinations.NewS3Bucket(bucket, &s3BucketProps{
// logging: jsii.Boolean(true),
// logGroup: logGroup,
// processor: processor,
// compression: destinations.compression_GZIP(),
// dataOutputPrefix: jsii.String("regularPrefix"),
// errorOutputPrefix: jsii.String("errorPrefix"),
// bufferingInterval: cdk.*duration.seconds(jsii.Number(60)),
// bufferingSize: cdk.*size.mebibytes(jsii.Number(1)),
// encryptionKey: key,
// s3Backup: &destinationS3BackupProps{
// mode: destinations.backupMode_ALL,
// bucket: backupBucket,
// compression: destinations.*compression_ZIP(),
// dataOutputPrefix: jsii.String("backupPrefix"),
// errorOutputPrefix: jsii.String("backupErrorPrefix"),
// bufferingInterval: cdk.*duration.seconds(jsii.Number(60)),
// bufferingSize: cdk.*size.mebibytes(jsii.Number(1)),
// encryptionKey: backupKey,
// },
// }),
// },
// })
//
// app.synth()
//
// Experimental.
type DestinationS3BackupProps struct {
// The length of time that Firehose buffers incoming data before delivering it to the S3 bucket.
//
// Minimum: Duration.seconds(60)
// Maximum: Duration.seconds(900)
// Experimental.
BufferingInterval awscdk.Duration `field:"optional" json:"bufferingInterval" yaml:"bufferingInterval"`
// The size of the buffer that Kinesis Data Firehose uses for incoming data before delivering it to the S3 bucket.
//
// Minimum: Size.mebibytes(1)
// Maximum: Size.mebibytes(128)
// Experimental.
BufferingSize awscdk.Size `field:"optional" json:"bufferingSize" yaml:"bufferingSize"`
// The type of compression that Kinesis Data Firehose uses to compress the data that it delivers to the Amazon S3 bucket.
//
// The compression formats SNAPPY or ZIP cannot be specified for Amazon Redshift
// destinations because they are not supported by the Amazon Redshift COPY operation
// that reads from the S3 bucket.
// Experimental.
Compression Compression `field:"optional" json:"compression" yaml:"compression"`
// A prefix that Kinesis Data Firehose evaluates and adds to records before writing them to S3.
//
// This prefix appears immediately following the bucket name.
// See: https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html
//
// Experimental.
DataOutputPrefix *string `field:"optional" json:"dataOutputPrefix" yaml:"dataOutputPrefix"`
// The AWS KMS key used to encrypt the data that it delivers to your Amazon S3 bucket.
// Experimental.
EncryptionKey awskms.IKey `field:"optional" json:"encryptionKey" yaml:"encryptionKey"`
// A prefix that Kinesis Data Firehose evaluates and adds to failed records before writing them to S3.
//
// This prefix appears immediately following the bucket name.
// See: https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html
//
// Experimental.
ErrorOutputPrefix *string `field:"optional" json:"errorOutputPrefix" yaml:"errorOutputPrefix"`
// The S3 bucket that will store data and failed records.
// Experimental.
Bucket awss3.IBucket `field:"optional" json:"bucket" yaml:"bucket"`
// If true, log errors when data transformation or data delivery fails.
//
// If `logGroup` is provided, this will be implicitly set to `true`.
// Experimental.
Logging *bool `field:"optional" json:"logging" yaml:"logging"`
// The CloudWatch log group where log streams will be created to hold error logs.
// Experimental.
LogGroup awslogs.ILogGroup `field:"optional" json:"logGroup" yaml:"logGroup"`
// Indicates the mode by which incoming records should be backed up to S3, if any.
//
// If `bucket` is provided, this will be implicitly set to `BackupMode.ALL`.
// Experimental.
Mode BackupMode `field:"optional" json:"mode" yaml:"mode"`
}
// An S3 bucket destination for data from a Kinesis Data Firehose delivery stream.
//
// Example:
// var bucket bucket
// // Provide a Lambda function that will transform records before delivery, with custom
// // buffering and retry configuration
// lambdaFunction := lambda.NewFunction(this, jsii.String("Processor"), &functionProps{
// runtime: lambda.runtime_NODEJS_12_X(),
// handler: jsii.String("index.handler"),
// code: lambda.code.fromAsset(path.join(__dirname, jsii.String("process-records"))),
// })
// lambdaProcessor := firehose.NewLambdaFunctionProcessor(lambdaFunction, &dataProcessorProps{
// bufferInterval: awscdk.Duration.minutes(jsii.Number(5)),
// bufferSize: awscdk.Size.mebibytes(jsii.Number(5)),
// retries: jsii.Number(5),
// })
// s3Destination := destinations.NewS3Bucket(bucket, &s3BucketProps{
// processor: lambdaProcessor,
// })
// firehose.NewDeliveryStream(this, jsii.String("Delivery Stream"), &deliveryStreamProps{
// destinations: []iDestination{
// s3Destination,
// },
// })
//
// Experimental.
type S3Bucket interface {
awskinesisfirehose.IDestination
// Binds this destination to the Kinesis Data Firehose delivery stream.
//
// Implementers should use this method to bind resources to the stack and initialize values using the provided stream.
// Experimental.
Bind(scope constructs.Construct, _options *awskinesisfirehose.DestinationBindOptions) *awskinesisfirehose.DestinationConfig
}
// The jsii proxy struct for S3Bucket
type jsiiProxy_S3Bucket struct {
internal.Type__awskinesisfirehoseIDestination
}
// Experimental.
func NewS3Bucket(bucket awss3.IBucket, props *S3BucketProps) S3Bucket {
_init_.Initialize()
j := jsiiProxy_S3Bucket{}
_jsii_.Create(
"monocdk.aws_kinesisfirehose_destinations.S3Bucket",
[]interface{}{bucket, props},
&j,
)
return &j
}
// Experimental.
func NewS3Bucket_Override(s S3Bucket, bucket awss3.IBucket, props *S3BucketProps) {
_init_.Initialize()
_jsii_.Create(
"monocdk.aws_kinesisfirehose_destinations.S3Bucket",
[]interface{}{bucket, props},
s,
)
}
func (s *jsiiProxy_S3Bucket) Bind(scope constructs.Construct, _options *awskinesisfirehose.DestinationBindOptions) *awskinesisfirehose.DestinationConfig {
var returns *awskinesisfirehose.DestinationConfig
_jsii_.Invoke(
s,
"bind",
[]interface{}{scope, _options},
&returns,
)
return returns
}
// Props for defining an S3 destination of a Kinesis Data Firehose delivery stream.
//
// Example:
// var bucket bucket
// // Provide a Lambda function that will transform records before delivery, with custom
// // buffering and retry configuration
// lambdaFunction := lambda.NewFunction(this, jsii.String("Processor"), &functionProps{
// runtime: lambda.runtime_NODEJS_12_X(),
// handler: jsii.String("index.handler"),
// code: lambda.code.fromAsset(path.join(__dirname, jsii.String("process-records"))),
// })
// lambdaProcessor := firehose.NewLambdaFunctionProcessor(lambdaFunction, &dataProcessorProps{
// bufferInterval: awscdk.Duration.minutes(jsii.Number(5)),
// bufferSize: awscdk.Size.mebibytes(jsii.Number(5)),
// retries: jsii.Number(5),
// })
// s3Destination := destinations.NewS3Bucket(bucket, &s3BucketProps{
// processor: lambdaProcessor,
// })
// firehose.NewDeliveryStream(this, jsii.String("Delivery Stream"), &deliveryStreamProps{
// destinations: []iDestination{
// s3Destination,
// },
// })
//
// Experimental.
type S3BucketProps struct {
// The length of time that Firehose buffers incoming data before delivering it to the S3 bucket.
//
// Minimum: Duration.seconds(60)
// Maximum: Duration.seconds(900)
// Experimental.
BufferingInterval awscdk.Duration `field:"optional" json:"bufferingInterval" yaml:"bufferingInterval"`
// The size of the buffer that Kinesis Data Firehose uses for incoming data before delivering it to the S3 bucket.
//
// Minimum: Size.mebibytes(1)
// Maximum: Size.mebibytes(128)
// Experimental.
BufferingSize awscdk.Size `field:"optional" json:"bufferingSize" yaml:"bufferingSize"`
// The type of compression that Kinesis Data Firehose uses to compress the data that it delivers to the Amazon S3 bucket.
//
// The compression formats SNAPPY or ZIP cannot be specified for Amazon Redshift
// destinations because they are not supported by the Amazon Redshift COPY operation
// that reads from the S3 bucket.
// Experimental.
Compression Compression `field:"optional" json:"compression" yaml:"compression"`
// A prefix that Kinesis Data Firehose evaluates and adds to records before writing them to S3.
//
// This prefix appears immediately following the bucket name.
// See: https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html
//
// Experimental.
DataOutputPrefix *string `field:"optional" json:"dataOutputPrefix" yaml:"dataOutputPrefix"`
// The AWS KMS key used to encrypt the data that it delivers to your Amazon S3 bucket.
// Experimental.
EncryptionKey awskms.IKey `field:"optional" json:"encryptionKey" yaml:"encryptionKey"`
// A prefix that Kinesis Data Firehose evaluates and adds to failed records before writing them to S3.
//
// This prefix appears immediately following the bucket name.
// See: https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html
//
// Experimental.
ErrorOutputPrefix *string `field:"optional" json:"errorOutputPrefix" yaml:"errorOutputPrefix"`
// If true, log errors when data transformation or data delivery fails.
//
// If `logGroup` is provided, this will be implicitly set to `true`.
// Experimental.
Logging *bool `field:"optional" json:"logging" yaml:"logging"`
// The CloudWatch log group where log streams will be created to hold error logs.
// Experimental.
LogGroup awslogs.ILogGroup `field:"optional" json:"logGroup" yaml:"logGroup"`
// The data transformation that should be performed on the data before writing to the destination.
// Experimental.
Processor awskinesisfirehose.IDataProcessor `field:"optional" json:"processor" yaml:"processor"`
// The IAM role associated with this destination.
//
// Assumed by Kinesis Data Firehose to invoke processors and write to destinations.
// Experimental.
Role awsiam.IRole `field:"optional" json:"role" yaml:"role"`
// The configuration for backing up source records to S3.
// Experimental.
S3Backup *DestinationS3BackupProps `field:"optional" json:"s3Backup" yaml:"s3Backup"`
}