Package: aws-solutions-constructs.aws-kinesis-streams-gluejob
aws-kinesisstreams-gluejob module---All classes are under active development and subject to non-backward compatible changes or removal in any
future version. These are not subject to theSemantic Versioningmodel.
This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.Reference Documentation:https://docs.aws.amazon.com/solutions/latest/constructs/LanguagePackagePythonaws_solutions_constructs.aws_kinesis_streams_gluejobTypescript@aws-solutions-constructs/aws-kinesisstreams-gluejobJavasoftware.amazon.awsconstructs.services.kinesisstreamsgluejobOverviewThis AWS Solutions Construct deploys a Kinesis Stream and configures a AWS Glue Job to perform custom ETL transformation with the appropriate resources/properties for interaction and security. It also creates an S3 bucket where the python script for the AWS Glue Job can be uploaded.Here is a minimal deployable pattern definition:Typescriptimport*asgluefrom"@aws-cdk/aws-glue";import*ass3assetsfrom"@aws-cdk/aws-s3-assets";import{KinesisstreamsToGluejob}from"@aws-solutions-constructs/aws-kinesisstreams-gluejob";constfieldSchema:glue.CfnTable.ColumnProperty[]=[{name:"id",type:"int",comment:"Identifier for the record",},{name:"name",type:"string",comment:"Name for the record",},{name:"address",type:"string",comment:"Address for the record",},{name:"value",type:"int",comment:"Value for the record",},];constcustomEtlJob=newKinesisstreamsToGluejob(this,"CustomETL",{glueJobProps:{command:{name:"gluestreaming",pythonVersion:"3",},},fieldSchema:fieldSchema,etlCodeAsset:news3assets.Asset(this,"ScriptLocation",{path:`${__dirname}/../etl/transform.py`,}),});Pattern Construct PropsNameTypeDescriptionexistingStreamObj?kinesis.StreamExisting instance of Kinesis Stream, providing both this andkinesisStreamPropswill cause an error.kinesisStreamProps?kinesis.StreamPropsOptional user-provided props to override the default props for the Kinesis stream.glueJobProps?cfnJob.CfnJobPropsUser provided props to override the default props for the AWS Glue Job.existingGlueJob?cfnJob.CfnJobExisting instance of AWS Glue Job, providing both this andglueJobPropswill cause an error.fieldSchema?CfnTable.ColumnProperty[]User provided schema structure to create an AWS Glue Table.existingTable?CfnTableExisting instance of AWS Glue Table. If this is set, tableProps and fieldSchema are ignored.tableProps?CfnTablePropsUser provided AWS Glue Table props to override default props used to create a Glue Table.existingDatabase?CfnDatabaseExisting instance of AWS Glue Database. If this is set, then databaseProps is ignored.databaseProps?CfnDatabasePropsUser provided Glue Database Props to override the default props used to create the Glue Database.outputDataStore?SinkDataStorePropsUser provided properties for S3 bucket that stores Glue Job output. Current datastore types supported is only S3.createCloudWatchAlarms?booleanWhether to create recommended CloudWatch alarms for Kinesis Data Stream. Default value is set totrue.etlCodeAsset?s3assets.AssetUser provided instance of the Asset class that represents the ETL code on the local filesystemSinkDataStorePropsNameTypeDescriptionexistingS3OutputBucket?BucketExisting instance of S3 bucket where the data should be written. Providing both this andoutputBucketPropswill cause an error.outputBucketPropsBucketPropsUser provided bucket properties to create the S3 bucket to store the output from the AWS Glue Job.datastoreTypeSinkStoreTypeSink data store type.SinkStoreTypeEnumeration of data store types that could include S3, DynamoDB, DocumentDB, RDS or Redshift. Current construct implementation only supports S3, but potential to add other output types in the future.NameTypeDescriptionS3stringS3 storage typePattern PropertiesNameTypeDescriptionkinesisStreamkinesis.StreamReturns an instance of the Kinesis stream created or used by the pattern.glueJobCfnJobReturns an instance of AWS Glue Job created by the construct.glueJobRoleiam.RoleReturns an instance of the IAM Role created by the construct for the Glue Job.databaseCfnDatabaseReturns an instance of AWS Glue Database created by the construct.tableCfnTableReturns an instance of the AWS Glue Table created by the constructoutputBucket?s3.BucketReturns an instance of the output bucket created by the construct for the AWS Glue Job.cloudwatchAlarms?cloudwatch.Alarm[]Returns an array of recommended CloudWatch Alarms created by the construct for Kinesis Data stream.Default settingsOut of the box implementation of the Construct without any override will set the following defaults:Amazon Kinesis StreamConfigure least privilege access IAM role for Kinesis StreamEnable server-side encryption for Kinesis Stream using AWS Managed KMS KeyDeploy best practices CloudWatch Alarms for the Kinesis StreamGlue JobCreate a Glue Security Config that configures encryption for CloudWatch, Job Bookmarks, and S3. CloudWatch and Job Bookmarks are encrypted using AWS Managed KMS Key created for AWS Glue Service. The S3 bucket is configured with SSE-S3 encryption modeConfigure service role policies that allow AWS Glue to read from Kinesis Data StreamsGlue DatabaseCreate an AWS Glue database. An AWS Glue Table will be added to the database. This table defines the schema for the records buffered in the Amazon Kinesis Data StreamsGlue TableCreate an AWS Glue table. The table schema definition is based on the JSON structure of the records buffered in the Amazon Kinesis Data StreamsIAM RoleA job execution role that has privileges to 1) read the ETL script from the S3 bucket location, 2) read records from the Kinesis Stream, and 3) execute the Glue JobOutput S3 BucketAn S3 bucket to store the output of the ETL transformation. This bucket will be passed as an argument to the created glue job so that it can be used in the ETL script to write data into itCloudwatch AlarmsA CloudWatch Alarm to report when consumer application is reading data slower than expectedA CloudWatch Alarm to report when consumer record processing is falling behind (to avoid risk of data loss due to record expiration)ArchitectureReference ImplementationA sample use case which uses this pattern is available underuse_cases/aws-custom-glue-etl.© Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.