Documentation
¶
Overview ¶
CDK Destinations Constructs for AWS Kinesis Firehose
CDK Destinations Constructs for AWS Kinesis Firehose ¶
CDK Destinations Constructs for AWS Kinesis Firehose ¶
CDK Destinations Constructs for AWS Kinesis Firehose ¶
CDK Destinations Constructs for AWS Kinesis Firehose ¶
CDK Destinations Constructs for AWS Kinesis Firehose ¶
CDK Destinations Constructs for AWS Kinesis Firehose ¶
CDK Destinations Constructs for AWS Kinesis Firehose ¶
CDK Destinations Constructs for AWS Kinesis Firehose
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewS3Bucket_Override ¶
func NewS3Bucket_Override(s S3Bucket, bucket awss3.IBucket, props *S3BucketProps)
Experimental.
Types ¶
type BackupMode ¶
type BackupMode string
Options for S3 record backup of a delivery stream.
Example:
// Enable backup of all source records (to an S3 bucket created by CDK). var bucket bucket // Explicitly provide an S3 bucket to which all source records will be backed up. var backupBucket bucket firehose.NewDeliveryStream(this, jsii.String("Delivery Stream Backup All"), &DeliveryStreamProps{ Destinations: []iDestination{ destinations.NewS3Bucket(bucket, &S3BucketProps{ S3Backup: &DestinationS3BackupProps{ Mode: destinations.BackupMode_ALL, }, }), }, }) firehose.NewDeliveryStream(this, jsii.String("Delivery Stream Backup All Explicit Bucket"), &DeliveryStreamProps{ Destinations: []*iDestination{ destinations.NewS3Bucket(bucket, &S3BucketProps{ S3Backup: &DestinationS3BackupProps{ Bucket: backupBucket, }, }), }, }) // Explicitly provide an S3 prefix under which all source records will be backed up. // Explicitly provide an S3 prefix under which all source records will be backed up. firehose.NewDeliveryStream(this, jsii.String("Delivery Stream Backup All Explicit Prefix"), &DeliveryStreamProps{ Destinations: []*iDestination{ destinations.NewS3Bucket(bucket, &S3BucketProps{ S3Backup: &DestinationS3BackupProps{ Mode: destinations.BackupMode_ALL, DataOutputPrefix: jsii.String("mybackup"), }, }), }, })
Experimental.
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" )
type CommonDestinationProps ¶
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 awscdkkinesisfirehosealpha.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"` }
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 kinesisfirehose_alpha "github.com/aws/aws-cdk-go/awscdkkinesisfirehosealpha" import kinesisfirehose_destinations_alpha "github.com/aws/aws-cdk-go/awscdkkinesisfirehosedestinationsalpha" import cdk "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 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: cdk.Duration_Minutes(jsii.Number(30)), BufferingSize: size, Compression: compression, DataOutputPrefix: jsii.String("dataOutputPrefix"), EncryptionKey: key, ErrorOutputPrefix: jsii.String("errorOutputPrefix"), Logging: jsii.Boolean(false), LogGroup: logGroup, Mode: kinesisfirehose_destinations_alpha.BackupMode_ALL, }, }
Experimental.
type CommonDestinationS3Props ¶
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"` }
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 kinesisfirehose_destinations_alpha "github.com/aws/aws-cdk-go/awscdkkinesisfirehosedestinationsalpha" import cdk "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var compression compression var key key var size size commonDestinationS3Props := &CommonDestinationS3Props{ BufferingInterval: cdk.Duration_Minutes(jsii.Number(30)), BufferingSize: size, Compression: compression, DataOutputPrefix: jsii.String("dataOutputPrefix"), EncryptionKey: key, ErrorOutputPrefix: jsii.String("errorOutputPrefix"), }
Experimental.
type Compression ¶
type Compression interface { // the string value of the Compression. // Experimental. Value() *string }
Possible compression options Kinesis Data Firehose can use to compress data on delivery.
Example:
// Compress data delivered to S3 using Snappy var bucket bucket s3Destination := destinations.NewS3Bucket(bucket, &S3BucketProps{ Compression: destinations.Compression_SNAPPY(), }) firehose.NewDeliveryStream(this, jsii.String("Delivery Stream"), &DeliveryStreamProps{ Destinations: []iDestination{ s3Destination, }, })
Experimental.
func Compression_GZIP ¶
func Compression_GZIP() Compression
func Compression_HADOOP_SNAPPY ¶
func Compression_HADOOP_SNAPPY() Compression
func Compression_Of ¶
func Compression_Of(value *string) Compression
Creates a new Compression instance with a custom value. Experimental.
func Compression_SNAPPY ¶
func Compression_SNAPPY() Compression
func Compression_ZIP ¶
func Compression_ZIP() Compression
type DestinationS3BackupProps ¶
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"` }
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:
// Enable backup of all source records (to an S3 bucket created by CDK). var bucket bucket // Explicitly provide an S3 bucket to which all source records will be backed up. var backupBucket bucket firehose.NewDeliveryStream(this, jsii.String("Delivery Stream Backup All"), &DeliveryStreamProps{ Destinations: []iDestination{ destinations.NewS3Bucket(bucket, &S3BucketProps{ S3Backup: &DestinationS3BackupProps{ Mode: destinations.BackupMode_ALL, }, }), }, }) firehose.NewDeliveryStream(this, jsii.String("Delivery Stream Backup All Explicit Bucket"), &DeliveryStreamProps{ Destinations: []*iDestination{ destinations.NewS3Bucket(bucket, &S3BucketProps{ S3Backup: &DestinationS3BackupProps{ Bucket: backupBucket, }, }), }, }) // Explicitly provide an S3 prefix under which all source records will be backed up. // Explicitly provide an S3 prefix under which all source records will be backed up. firehose.NewDeliveryStream(this, jsii.String("Delivery Stream Backup All Explicit Prefix"), &DeliveryStreamProps{ Destinations: []*iDestination{ destinations.NewS3Bucket(bucket, &S3BucketProps{ S3Backup: &DestinationS3BackupProps{ Mode: destinations.BackupMode_ALL, DataOutputPrefix: jsii.String("mybackup"), }, }), }, })
Experimental.
type S3Bucket ¶
type S3Bucket interface { awscdkkinesisfirehosealpha.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 *awscdkkinesisfirehosealpha.DestinationBindOptions) *awscdkkinesisfirehosealpha.DestinationConfig }
An S3 bucket destination for data from a Kinesis Data Firehose delivery stream.
Example:
// Specify the roles created above when defining the destination and delivery stream. var bucket bucket // Create service roles for the delivery stream and destination. // These can be used for other purposes and granted access to different resources. // They must include the Kinesis Data Firehose service principal in their trust policies. // Two separate roles are shown below, but the same role can be used for both purposes. deliveryStreamRole := iam.NewRole(this, jsii.String("Delivery Stream Role"), &RoleProps{ AssumedBy: iam.NewServicePrincipal(jsii.String("firehose.amazonaws.com")), }) destinationRole := iam.NewRole(this, jsii.String("Destination Role"), &RoleProps{ AssumedBy: iam.NewServicePrincipal(jsii.String("firehose.amazonaws.com")), }) destination := destinations.NewS3Bucket(bucket, &S3BucketProps{ Role: destinationRole, }) firehose.NewDeliveryStream(this, jsii.String("Delivery Stream"), &DeliveryStreamProps{ Destinations: []iDestination{ destination, }, Role: deliveryStreamRole, })
Experimental.
func NewS3Bucket ¶
func NewS3Bucket(bucket awss3.IBucket, props *S3BucketProps) S3Bucket
Experimental.
type S3BucketProps ¶
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 awscdkkinesisfirehosealpha.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"` }
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_14_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.