Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(kinesisfirehose): support Redshift table destination #15837

Closed
wants to merge 294 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
294 commits
Select commit Hold shift + click to select a range
db9ea21
update README
madeline-k Jul 19, 2021
49a839e
Use L1 types in DestinationConfig returned from bind()
madeline-k Jul 19, 2021
c846f4d
Merge branch 'madeline-k/feat/kinesisfirehose-deliverystream' into ma…
madeline-k Jul 19, 2021
ff3fb60
Merge branch 'madeline-k/feat/kinesisfirehose-metrics' into madeline-…
madeline-k Jul 19, 2021
a2c85bd
remove DestinationBase, move createLoggingOptions and DestinationProps
BenChaimberg Jul 19, 2021
569ca01
don't pass role into bind()
madeline-k Jul 19, 2021
af2cb02
Merge branch 'madeline-k/feat/kinesisfirehose-deliverystream' into ma…
madeline-k Jul 19, 2021
b392d12
Merge branch 'madeline-k/feat/kinesisfirehose-metrics' into madeline-…
madeline-k Jul 19, 2021
5ee24d4
remove Node.addDependency's to avoid circular dependency
madeline-k Jul 20, 2021
c425f78
move integ test verification to core module instead of destinations m…
madeline-k Jul 20, 2021
469bf47
update tests and remove addDependency
madeline-k Jul 20, 2021
2514430
Merge branch 'madeline-k/feat/kinesisfirehose-sse' into madeline-k/fe…
madeline-k Jul 20, 2021
97fb6bc
fix build errors from merge
madeline-k Jul 20, 2021
42abd26
udpate implementation after merge
madeline-k Jul 20, 2021
db31e5a
Merge branch 'madeline-k/feat/kinesisfirehose-compression' into madel…
madeline-k Jul 20, 2021
5389186
update integ expected.json
madeline-k Jul 20, 2021
1ae1be4
Merge branch 'madeline-k/feat/kinesisfirehose-prefixes' into madeline…
madeline-k Jul 20, 2021
1f9c228
update unit tests after merge
madeline-k Jul 20, 2021
75f1b56
run integ tests and update expected.json
madeline-k Jul 20, 2021
0eb56d3
Merge branch 'madeline-k/feat/kinesisfirehose-buffering' into madelin…
madeline-k Jul 20, 2021
e3a9ec7
Delete integ.s3-all-properties.expected.json
madeline-k Jul 20, 2021
0883ade
re-run integ tests and update expected.json
madeline-k Jul 20, 2021
37ece90
Merge branch 'madeline-k/feat/kinesisfirehose-prefixes' into madeline…
madeline-k Jul 20, 2021
867b33e
Merge branch 'madeline-k/feat/kinesisfirehose-buffering' into madelin…
madeline-k Jul 20, 2021
a307108
feat(kinesisfirehose): destinations can provide resources to be depen…
BenChaimberg Jul 20, 2021
04d5ae7
remove unused custom-resources dependency
BenChaimberg Jul 20, 2021
93cc0e5
rewrite providing IAM role section (include separate destination role…
BenChaimberg Jul 21, 2021
3aa77bd
add more IAM role detail
BenChaimberg Jul 21, 2021
7883929
snapshot spacing
BenChaimberg Jul 21, 2021
1c65da6
Merge remote-tracking branch 'origin/master' into madeline-k/feat/kin…
BenChaimberg Jul 21, 2021
45fec81
make s3 destination props readonly
BenChaimberg Jul 21, 2021
28c120f
line length linting
BenChaimberg Jul 21, 2021
005402c
do not re-use log group if log group provided in props
BenChaimberg Jul 21, 2021
0f9d42d
rename DestinationProps -> CommonDestinationProps
BenChaimberg Jul 21, 2021
ed02d9f
move logging tests to S3 bucket destination
BenChaimberg Jul 21, 2021
83323ac
Merge branch 'madeline-k/feat/kinesisfirehose-deliverystream' into ma…
madeline-k Jul 21, 2021
9a31251
Merge branch 'madeline-k/feat/kinesisfirehose-metrics' into madeline-…
madeline-k Jul 21, 2021
142e096
re-run integration tests and update snapshot
madeline-k Jul 21, 2021
d075e18
Merge branch 'madeline-k/feat/kinesisfirehose-sse' into madeline-k/fe…
madeline-k Jul 21, 2021
645d59b
Merge branch 'madeline-k/feat/kinesisfirehose-compression' into madel…
madeline-k Jul 21, 2021
9a7fad1
Merge branch 'madeline-k/feat/kinesisfirehose-prefixes' into madeline…
madeline-k Jul 21, 2021
2cbe865
Merge branch 'madeline-k/feat/kinesisfirehose-buffering' into madelin…
madeline-k Jul 21, 2021
9cddb50
feat(aws-kinesisfirehose): support for Lambda data processors
madeline-k Jul 21, 2021
a1e5c52
update README to use correct S3Bucket class name
madeline-k Jul 21, 2021
ff92e3e
Merge branch 'madeline-k/feat/kinesisfirehose-compression' into madel…
madeline-k Jul 21, 2021
6ea22a2
update README to use correct S3Bucket class name
madeline-k Jul 21, 2021
324f78c
Merge branch 'madeline-k/feat/kinesisfirehose-prefixes' into madeline…
madeline-k Jul 21, 2021
95aa481
update README to use correct S3Bucket class name
madeline-k Jul 21, 2021
96909d1
Merge branch 'madeline-k/feat/kinesisfirehose-buffering' into madelin…
madeline-k Jul 21, 2021
c39bb5a
update README to use correct S3Bucket class name
madeline-k Jul 21, 2021
ccd8097
Merge branch 'madeline-k/feat/kinesisfirehose-encryption-dest' into m…
madeline-k Jul 21, 2021
d541b9a
refactor unit tests
madeline-k Jul 21, 2021
00aa894
feat(aws-kinesisfirehose): Add support for backing up source records …
madeline-k Jul 22, 2021
aa857cd
add missing 'Bucket' to README
madeline-k Jul 22, 2021
c6a8553
Merge branch 'master' into madeline-k/feat/kinesisfirehose-deliveryst…
madeline-k Jul 22, 2021
e717474
Merge branch 'madeline-k/feat/kinesisfirehose-deliverystream' into ma…
madeline-k Jul 22, 2021
4b1f5fe
Merge branch 'madeline-k/feat/kinesisfirehose-metrics' into madeline-…
madeline-k Jul 22, 2021
7071ba9
Merge branch 'madeline-k/feat/kinesisfirehose-sse' into madeline-k/fe…
madeline-k Jul 22, 2021
f1ecc73
Merge branch 'madeline-k/feat/kinesisfirehose-compression' into madel…
madeline-k Jul 22, 2021
7dce50f
Merge branch 'madeline-k/feat/kinesisfirehose-prefixes' into madeline…
madeline-k Jul 22, 2021
29ea6f5
Merge branch 'madeline-k/feat/kinesisfirehose-buffering' into madelin…
madeline-k Jul 22, 2021
583b2fe
Merge branch 'madeline-k/feat/kinesisfirehose-encryption-dest' into m…
madeline-k Jul 22, 2021
b95455e
Merge branch 'madeline-k/feat/kinesisfirehose-dataprocessors' into ma…
madeline-k Jul 22, 2021
2bcc663
Merge branch 'master' of github.com:aws/aws-cdk into madeline-k/feat/…
BenChaimberg Jul 22, 2021
98d6371
use new lazy mappings for CIDR blocks
BenChaimberg Jul 22, 2021
e006441
update S3 -> S3Bucket class name in default.ts-fixture
madeline-k Jul 22, 2021
814c61e
remove example that won't translate to other languages
madeline-k Jul 22, 2021
6bc7b60
Merge branch 'madeline-k/feat/kinesisfirehose-dataprocessors' into ma…
madeline-k Jul 22, 2021
52d78d4
Merge branch 'madeline-k/feat/kinesisfirehose-deliverystream' into ma…
madeline-k Jul 22, 2021
86c7cb7
Apply suggestions from code review
madeline-k Jul 22, 2021
f8b03c4
remove private index.ts
madeline-k Jul 22, 2021
8c2903e
hardcode logical IDs in unit tests
madeline-k Jul 22, 2021
2b3b2cf
Merge branch 'madeline-k/feat/kinesisfirehose-deliverystream' into ma…
madeline-k Jul 22, 2021
b7b897d
Merge branch 'madeline-k/feat/kinesisfirehose-metrics' into madeline-…
madeline-k Jul 22, 2021
5aab535
Merge branch 'madeline-k/feat/kinesisfirehose-sse' into madeline-k/fe…
madeline-k Jul 22, 2021
8c0cfe3
Merge branch 'madeline-k/feat/kinesisfirehose-compression' into madel…
madeline-k Jul 22, 2021
d916736
Merge branch 'madeline-k/feat/kinesisfirehose-prefixes' into madeline…
madeline-k Jul 22, 2021
71b4239
Merge branch 'madeline-k/feat/kinesisfirehose-buffering' into madelin…
madeline-k Jul 22, 2021
569743b
Merge branch 'madeline-k/feat/kinesisfirehose-encryption-dest' into m…
madeline-k Jul 22, 2021
65bc7c5
Merge branch 'madeline-k/feat/kinesisfirehose-dataprocessors' into ma…
madeline-k Jul 22, 2021
8045edc
update tests
madeline-k Jul 22, 2021
4827969
Merge branch 'madeline-k/feat/kinesisfirehose-dataprocessors' into ma…
madeline-k Jul 22, 2021
ddcbd31
fix typo
madeline-k Jul 22, 2021
7792efa
add unit tests
madeline-k Jul 23, 2021
407ca46
Merge branch 'madeline-k/feat/kinesisfirehose-buffering' into madelin…
madeline-k Jul 23, 2021
93071c5
unit tests
madeline-k Jul 23, 2021
0417b29
Merge branch 'madeline-k/feat/kinesisfirehose-encryption-dest' into m…
madeline-k Jul 23, 2021
ab33d0f
Merge branch 'master' into madeline-k/feat/kinesisfirehose-metrics
madeline-k Jul 23, 2021
0e63e66
Merge branch 'madeline-k/feat/kinesisfirehose-metrics' into madeline-…
madeline-k Jul 23, 2021
df298b0
Merge branch 'madeline-k/feat/kinesisfirehose-sse' into madeline-k/fe…
madeline-k Jul 23, 2021
7d5956d
Merge branch 'madeline-k/feat/kinesisfirehose-compression' into madel…
madeline-k Jul 23, 2021
09bfa3a
Merge branch 'madeline-k/feat/kinesisfirehose-prefixes' into madeline…
madeline-k Jul 23, 2021
31a5c51
Merge branch 'madeline-k/feat/kinesisfirehose-buffering' into madelin…
madeline-k Jul 23, 2021
89e6f8e
Merge branch 'madeline-k/feat/kinesisfirehose-encryption-dest' into m…
madeline-k Jul 23, 2021
f19704b
Merge branch 'madeline-k/feat/kinesisfirehose-dataprocessors' into ma…
madeline-k Jul 23, 2021
12211e3
Update packages/@aws-cdk/aws-kinesisfirehose/README.md
madeline-k Jul 23, 2021
124c354
remove unused dev dependencies
madeline-k Jul 26, 2021
43f2ecf
Update packages/@aws-cdk/aws-kinesisfirehose/test/delivery-stream.tes…
madeline-k Jul 26, 2021
3325990
Update packages/@aws-cdk/aws-kinesisfirehose/test/delivery-stream.tes…
madeline-k Jul 26, 2021
34e29b4
Update packages/@aws-cdk/aws-kinesisfirehose-destinations/lib/private…
madeline-k Jul 26, 2021
8ac8ea3
Merge branch 'master' into madeline-k/feat/kinesisfirehose-metrics
madeline-k Jul 27, 2021
950724e
make constructor props available as a readonly property on the DataPr…
madeline-k Jul 27, 2021
8bc6c88
README formatting
BenChaimberg Jul 28, 2021
1aa653e
deduplicate delivery stream creation in metrics tests
BenChaimberg Jul 28, 2021
9ee3651
Merge remote-tracking branch 'origin/madeline-k/feat/kinesisfirehose-…
BenChaimberg Jul 28, 2021
44d3805
README formatting
BenChaimberg Jul 28, 2021
6207614
docstring clarification of defaults
BenChaimberg Jul 28, 2021
5c790a6
add comment detailing why explicit dependency on key grant is not added
BenChaimberg Jul 28, 2021
61391a4
Merge branch 'madeline-k/feat/kinesisfirehose-sse' into madeline-k/fe…
BenChaimberg Jul 28, 2021
c30312d
remove Compression.UNCOMPRESSED, add Compression.of, make constructor…
BenChaimberg Jul 28, 2021
380ad3d
Merge branch 'madeline-k/feat/kinesisfirehose-compression' into madel…
BenChaimberg Jul 28, 2021
9fe4d6a
rename prefix -> dataOutputPrefix
BenChaimberg Jul 28, 2021
bd114cb
Merge branch 'madeline-k/feat/kinesisfirehose-prefixes' into madeline…
BenChaimberg Jul 28, 2021
41e01e9
don't force users to provide buffering values when we have defaults
BenChaimberg Jul 28, 2021
f388b3c
Merge branch 'madeline-k/feat/kinesisfirehose-buffering' into madelin…
BenChaimberg Jul 28, 2021
d54389d
remove duplicated test
BenChaimberg Jul 28, 2021
8dbb5ae
typo and unnecessary truthy testing
BenChaimberg Jul 28, 2021
24f53cf
apply Adam's feedback
madeline-k Jul 28, 2021
c471df4
move processor.ts to firehose module
madeline-k Jul 28, 2021
fb0c21a
separate LambdaFunctionProcessor to its own file
madeline-k Jul 28, 2021
7419fa0
Merge branch 'madeline-k/feat/kinesisfirehose-encryption-dest' into m…
madeline-k Jul 28, 2021
2663007
fix trailing comma in package.json after merge
madeline-k Jul 28, 2021
a3dde9d
Merge branch 'madeline-k/feat/kinesisfirehose-dataprocessors' into ma…
madeline-k Jul 28, 2021
eaaf8f0
Merge branch 'madeline-k/feat/kinesisfirehose-backup' of github.com:a…
madeline-k Jul 28, 2021
57e37a9
remove BackupMode.DISABLED, rename DestinationBackupOutput to Destina…
madeline-k Jul 28, 2021
dcb21ba
rename DestinationLoggingOutput to DestinationLoggingConfig
madeline-k Jul 28, 2021
5f4577a
Merge branch 'master' into madeline-k/feat/kinesisfirehose-metrics
madeline-k Jul 28, 2021
6ac183e
Merge branch 'madeline-k/feat/kinesisfirehose-metrics' into madeline-…
madeline-k Jul 28, 2021
387fbef
Merge branch 'madeline-k/feat/kinesisfirehose-sse' into madeline-k/fe…
madeline-k Jul 28, 2021
46d48d3
Merge branch 'madeline-k/feat/kinesisfirehose-compression' into madel…
madeline-k Jul 28, 2021
b223955
Merge branch 'madeline-k/feat/kinesisfirehose-prefixes' into madeline…
madeline-k Jul 28, 2021
97e03d7
Merge branch 'madeline-k/feat/kinesisfirehose-buffering' into madelin…
madeline-k Jul 28, 2021
bf1452f
Merge branch 'madeline-k/feat/kinesisfirehose-encryption-dest' into m…
madeline-k Jul 28, 2021
f5702aa
Merge branch 'madeline-k/feat/kinesisfirehose-dataprocessors' into ma…
madeline-k Jul 28, 2021
1a525bf
add missing newlines to end of files
madeline-k Jul 28, 2021
865a9aa
move backupMode validation to constructor
madeline-k Jul 28, 2021
9793012
only add BufferingHints to template if user defined them
madeline-k Jul 28, 2021
397c56f
add verification that either both or neither of bufferringInterval an…
madeline-k Jul 28, 2021
2772b1f
remove direct import of S3Bucket
madeline-k Jul 28, 2021
81672d5
allow user to specify only one of bufferingInterval and bufferingSize
madeline-k Jul 28, 2021
a33eff2
refactor backup props existence checking logic
madeline-k Jul 28, 2021
ba08799
Apply suggestions from code review
madeline-k Jul 28, 2021
2748ea9
inline processorIdentifier
madeline-k Jul 28, 2021
ca59756
refactor so that processor.bind() can return the constructor props i.…
madeline-k Jul 28, 2021
9f9c7f8
Merge branch 'master' into madeline-k/feat/kinesisfirehose-compression
madeline-k Jul 28, 2021
0754886
Revert "refactor so that processor.bind() can return the constructor …
madeline-k Jul 28, 2021
84e6773
remove ProcessorProperty creation logic to separate function
madeline-k Jul 28, 2021
385a49c
refactor createProcessingConfig
madeline-k Jul 28, 2021
e6b6e6c
refactor API to only accept one processor instead of an array
madeline-k Jul 28, 2021
61ccc68
udpate README
madeline-k Jul 28, 2021
e8f116c
add lit suffix to integ test
madeline-k Jul 28, 2021
bcb6b37
add lit suffix to integration test reference in README
madeline-k Jul 28, 2021
2b31c9f
some renaming
madeline-k Jul 28, 2021
1351caf
remove redundant 'backup' in some property names
madeline-k Jul 28, 2021
98f91f0
Apply suggestions from code review
madeline-k Jul 28, 2021
d47d4b7
Update packages/@aws-cdk/aws-kinesisfirehose/README.md
madeline-k Jul 28, 2021
e0f7901
Merge branch 'madeline-k/feat/kinesisfirehose-compression' into madel…
madeline-k Jul 28, 2021
e6ffd73
Merge branch 'madeline-k/feat/kinesisfirehose-prefixes' into madeline…
madeline-k Jul 28, 2021
bbc3700
Merge branch 'madeline-k/feat/kinesisfirehose-buffering' into madelin…
madeline-k Jul 28, 2021
5fdb4b7
Merge branch 'madeline-k/feat/kinesisfirehose-encryption-dest' into m…
madeline-k Jul 28, 2021
01d2ed8
Merge branch 'madeline-k/feat/kinesisfirehose-dataprocessors' into ma…
madeline-k Jul 28, 2021
1e9da98
fix file reference to integration test in README
madeline-k Jul 28, 2021
d2af3de
Merge branch 'madeline-k/feat/kinesisfirehose-dataprocessors' into ma…
madeline-k Jul 28, 2021
263738d
update README
madeline-k Jul 28, 2021
07d96c1
don't add unnecessary fields to the template if backup is disabled
madeline-k Jul 28, 2021
e36969d
don't add encryptionconfiguration to template unless it is needed
madeline-k Jul 28, 2021
bf6f4bc
Merge branch 'master' into madeline-k/feat/kinesisfirehose-encryption…
madeline-k Jul 29, 2021
6f599a5
Merge branch 'madeline-k/feat/kinesisfirehose-encryption-dest' into m…
madeline-k Jul 29, 2021
0eca26d
Merge branch 'madeline-k/feat/kinesisfirehose-dataprocessors' into ma…
madeline-k Jul 29, 2021
22ef045
fix unit tests after merge
madeline-k Jul 29, 2021
d1a6905
Remove outdated buffering docs
BenChaimberg Jul 29, 2021
8efe8d9
Merge remote-tracking branch 'origin/master' into madeline-k/feat/kin…
BenChaimberg Jul 29, 2021
72d7478
feat(kinesisfirehose): supports Kinesis data stream source for delive…
BenChaimberg Jul 30, 2021
4d02d51
add to README
BenChaimberg Jul 30, 2021
88e31aa
feat(kinesisfirehose): support Redshift cluster destination
BenChaimberg Jul 26, 2021
c4c865c
add to README
BenChaimberg Jul 30, 2021
c0d72ac
move RedshiftColumn to top level to avoid monocdk broken export
BenChaimberg Jul 30, 2021
ca0520a
Merge branch 'master' into chaimber/firehose-kinesis-source
BenChaimberg Aug 3, 2021
c53bdf3
fix merged tests
BenChaimberg Aug 3, 2021
0657db0
docs and formatting
BenChaimberg Aug 3, 2021
9355b78
Merge remote-tracking branch 'origin/master' into chaimber/firehose-k…
BenChaimberg Aug 3, 2021
67f34e8
redesign how users and tables are provided, make cr provider handlers…
BenChaimberg Aug 3, 2021
44cccb9
Merge branch 'chaimber/firehose-kinesis-source' of github.com:aws/aws…
BenChaimberg Aug 4, 2021
c67067c
move to new assertions module
BenChaimberg Aug 4, 2021
749a52a
remove second person subject in reference docs
BenChaimberg Aug 4, 2021
ea181aa
clean up admin user error messages
BenChaimberg Aug 4, 2021
1ded5fa
remove public database and table name properties
BenChaimberg Aug 4, 2021
1d923e3
feat(redshift): manage database users and tables via custom resources
BenChaimberg Aug 6, 2021
ca7b5f6
Merge branch 'master' of github.com:aws/aws-cdk into chaimber/kinesis…
BenChaimberg Aug 7, 2021
1e613d3
Merge branch 'chaimber/redshift-database-query' into chaimber/kinesis…
BenChaimberg Aug 7, 2021
9d3827d
add cluster and databaseName to interfaces
BenChaimberg Aug 7, 2021
a25c3bc
Merge branch 'chaimber/redshift-database-query' into chaimber/kinesis…
BenChaimberg Aug 7, 2021
e3cf751
move redshift user and table to redshift module
BenChaimberg Aug 7, 2021
6fef1ec
Merge branch 'master' of github.com:aws/aws-cdk into chaimber/redshif…
BenChaimberg Aug 7, 2021
cf19417
Merge branch 'chaimber/redshift-database-query' into chaimber/kinesis…
BenChaimberg Aug 7, 2021
2708e9b
remove outdated docs
BenChaimberg Aug 7, 2021
015d05d
update integ test
BenChaimberg Aug 7, 2021
1f58168
move database props to separate file to pass monocdk build
BenChaimberg Aug 7, 2021
5abb214
Merge branch 'chaimber/redshift-database-query' into chaimber/kinesis…
BenChaimberg Aug 7, 2021
ee914b0
fix empty cluster attached roles array, add tests
BenChaimberg Aug 8, 2021
9154a67
update integ tests
BenChaimberg Aug 8, 2021
06a7570
add to README
BenChaimberg Aug 8, 2021
a474705
Merge branch 'master' of github.com:aws/aws-cdk into chaimber/redshif…
BenChaimberg Aug 24, 2021
9d67a38
updated documentation and linting
BenChaimberg Aug 24, 2021
3bb16b1
update integ tests
BenChaimberg Aug 24, 2021
f228c18
move user table privileges to separate construct
BenChaimberg Aug 24, 2021
bd1fef5
only update table if columns added (replace in all other cases); add …
BenChaimberg Aug 29, 2021
e889618
make DatabaseQuery generic, strongly type handlers, don't serialize p…
BenChaimberg Aug 30, 2021
10bb1e7
Merge branch 'master' of github.com:aws/aws-cdk into chaimber/redshif…
BenChaimberg Aug 30, 2021
b9f5a73
Merge branch 'master' of github.com:aws/aws-cdk into chaimber/redshif…
BenChaimberg Sep 4, 2021
1824a94
only use Table.grant to exemplify granting privileges
BenChaimberg Sep 4, 2021
a05d90d
DatabaseProps -> DatabaseOptions
BenChaimberg Sep 4, 2021
94b9429
enable strict rosetta compilation
BenChaimberg Sep 4, 2021
ddbebb6
make UserTablePrivileges private
BenChaimberg Sep 4, 2021
f3d1546
rename provider files and handlers
BenChaimberg Sep 4, 2021
8845907
linting
BenChaimberg Sep 4, 2021
192e0d0
add aws-sdk to dev deps
BenChaimberg Sep 4, 2021
1374ced
more DatabaseProps -> DatabaseOptions
BenChaimberg Sep 5, 2021
b16f694
make readme compile
BenChaimberg Sep 5, 2021
130c955
update integ test
BenChaimberg Sep 5, 2021
e98ac39
Revert "update integ test"
BenChaimberg Sep 5, 2021
24c63b4
add more provider tests and fixes
BenChaimberg Sep 5, 2021
e446f32
linting
BenChaimberg Sep 5, 2021
d30531e
update integ test
BenChaimberg Sep 7, 2021
6e75d11
document reasons for not granting duplicate privileges in multiple apps
BenChaimberg Sep 9, 2021
156e72e
remove TODOs in code
BenChaimberg Sep 9, 2021
b7610dc
Merge branch 'master' of github.com:aws/aws-cdk into chaimber/redshif…
BenChaimberg Sep 9, 2021
1a44e32
rewrite opening paragraph in readme
BenChaimberg Sep 9, 2021
378f101
lint readme snippets
BenChaimberg Sep 9, 2021
307214f
reduce table privileges to combine actions across multiple grant calls
BenChaimberg Sep 9, 2021
83b933a
remove magic handler names and replace with enum
BenChaimberg Sep 9, 2021
2a5f636
add tests to entrypoint of database query provider
BenChaimberg Sep 9, 2021
67114bc
Merge branch 'master' of github.com:aws/aws-cdk into chaimber/redshif…
BenChaimberg Sep 10, 2021
ada89e7
ignore asset hash in integration tests
BenChaimberg Sep 10, 2021
df7b1df
Merge branch 'master' of github.com:aws/aws-cdk into chaimber/redshif…
BenChaimberg Sep 10, 2021
20419c8
Merge branch 'chaimber/redshift-database-query' of github.com:aws/aws…
BenChaimberg Sep 11, 2021
f533242
fix location of handler name
BenChaimberg Sep 11, 2021
750a2f0
Merge branch 'chaimber/redshift-database-query' of github.com:aws/aws…
BenChaimberg Sep 11, 2021
2152d53
refactor in prep of correctly generating table name
BenChaimberg Sep 11, 2021
f5ab16d
properly generate table name so update replacements succeed
BenChaimberg Sep 11, 2021
2aff52e
Merge branch 'chaimber/redshift-database-query' of github.com:aws/aws…
BenChaimberg Sep 11, 2021
d9596fb
do not compare asset hashes in integration test
BenChaimberg Sep 12, 2021
17b9e2f
Merge branch 'master' into chaimber/redshift-database-query
BenChaimberg Sep 13, 2021
8add00c
typo
BenChaimberg Sep 13, 2021
7c3a144
Merge branch 'chaimber/redshift-database-query' of github.com:aws/aws…
BenChaimberg Sep 13, 2021
f04c2ed
add test for firehose->cluster connection
BenChaimberg Sep 15, 2021
3a0b815
update README
BenChaimberg Sep 15, 2021
67c3727
Merge branch 'master' into chaimber/kinesisfirehose-redshift
BenChaimberg Sep 15, 2021
40412e9
remove TODO
BenChaimberg Sep 15, 2021
c4a55d5
add documentation for default data format and how to change
BenChaimberg Sep 15, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './common';
export * from './s3-bucket';
export * from './redshift-table';
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
import * as iam from '@aws-cdk/aws-iam';
import * as firehose from '@aws-cdk/aws-kinesisfirehose';
import * as redshift from '@aws-cdk/aws-redshift';
import * as s3 from '@aws-cdk/aws-s3';
import * as cdk from '@aws-cdk/core';
import { Construct } from 'constructs';
import { BackupMode, CommonDestinationProps, CommonDestinationS3Props, Compression } from './common';
import { createBackupConfig, createBufferingHints, createEncryptionConfig, createLoggingOptions, createProcessingConfig } from './private/helpers';

/**
* Properties for configuring a Redshift delivery stream destination.
*/
export interface RedshiftDestinationProps extends CommonDestinationProps, CommonDestinationS3Props {
/**
* The Redshift user Firehose will assume to deliver data to the destination table.
*
* @default - a user is generated
*/
readonly user?: redshift.IUser;

/**
* Parameters given to the COPY command that is used to move data from S3 to Redshift.
*
* @see https://docs.aws.amazon.com/firehose/latest/APIReference/API_CopyCommand.html
* @example "json 'auto'"
*
* @default '' - no extra parameters are provided to the Redshift COPY command
BenChaimberg marked this conversation as resolved.
Show resolved Hide resolved
*/
readonly copyOptions?: string;

/**
* The length of time during which Firehose retries delivery after a failure.
*
* Minimum: None
* Maximum: Duration.hours(2)
*
* @default Duration.hours(1)
*/
readonly retryTimeout?: cdk.Duration;

/**
* The intermediate bucket where Firehose will stage the data before COPYing to the Redshift cluster.
*
* @default - a bucket will be created
*/
readonly intermediateBucket?: s3.IBucket;

/**
* The role that is attached to the Redshift cluster and will have permissions to access the intermediate bucket.
*
* If a role is provided, it must be already attached to the cluster, to avoid the 10 role per cluster limit.
*
* @default - a role will be created
*/
readonly bucketAccessRole?: iam.IRole;
}

/**
* Redshift table delivery stream destination.
*
* By default, the format of the data to be delivered is assumed to be character-delimited UTF-8
* text, where the delimeter is a pipe character (`|`). To accept source data in a different format,
* provide the appropriate value for `copyOptions`.
* @see https://docs.aws.amazon.com/redshift/latest/dg/copy-parameters-data-format.html
*/
export class RedshiftTable implements firehose.IDestination {
/**
* @param table The Redshift table that data should be inserted into.
*/
constructor(private readonly table: redshift.ITable, private readonly props: RedshiftDestinationProps = {}) {
const cluster = table.cluster;
if (!cluster.publiclyAccessible) {
throw new Error('Redshift cluster used as delivery stream destination is not publicly accessible');
}
if (!cluster.subnetGroup?.selectedSubnets?.hasPublic) {
throw new Error('Redshift cluster used as delivery stream destination is not located in a public subnet');
}
if (props.user) {
if (props.user.cluster !== table.cluster || props.user.databaseName !== table.databaseName) {
throw new Error('Provided Redshift user must be located in the same Redshift cluster and database as the table');
}
}
if (props.retryTimeout && props.retryTimeout.toSeconds() > cdk.Duration.hours(2).toSeconds()) {
throw new Error(`Retry timeout must be less than 7,200 seconds (2 hours), given ${props.retryTimeout.toSeconds()} seconds`);
}
if (props.compression === Compression.SNAPPY || props.compression === Compression.HADOOP_SNAPPY || props.compression === Compression.ZIP) {
throw new Error(`Redshift delivery stream destination does not support ${props.compression.value} compression`);
}
if (props.s3Backup?.mode === BackupMode.FAILED) {
throw new Error('Redshift delivery stream destination does not support ${props.s3Backup?.mode} backup mode');
}
}

public bind(scope: Construct, options: firehose.DestinationBindOptions): firehose.DestinationConfig {
const {
compression,
retryTimeout,
bufferingInterval,
bufferingSize,
copyOptions,
} = this.props;
const cluster = this.table.cluster;

const role = this.props.role ?? new iam.Role(scope, 'Redshift Destination Role', {
assumedBy: new iam.ServicePrincipal('firehose.amazonaws.com'),
});

const endpoint = cluster.clusterEndpoint;
const jdbcUrl = `jdbc:redshift://${endpoint.hostname}:${cdk.Token.asString(endpoint.port)}/${this.table.databaseName}`;
cluster.connections.allowDefaultPortFrom(options.connections, 'Allow incoming connections from Kinesis Data Firehose');
BenChaimberg marked this conversation as resolved.
Show resolved Hide resolved

const user = this.props.user ?? new redshift.User(scope, 'Redshift User', {
cluster: cluster,
databaseName: this.table.databaseName,
});
this.table.grant(user, redshift.TableAction.INSERT);
BenChaimberg marked this conversation as resolved.
Show resolved Hide resolved

const { loggingOptions: intermediateLoggingOptions, dependables: intermediateLoggingDependables } = createLoggingOptions(scope, {
logging: this.props.logging,
logGroup: this.props.logGroup,
role,
streamId: 'IntermediateS3',
}) ?? {};
const intermediateBucket = this.props.intermediateBucket ?? new s3.Bucket(scope, 'Intermediate Bucket');
intermediateBucket.grantReadWrite(role);
const intermediateS3Config: firehose.CfnDeliveryStream.S3DestinationConfigurationProperty = {
bucketArn: intermediateBucket.bucketArn,
roleArn: role.roleArn,
bufferingHints: createBufferingHints(bufferingInterval, bufferingSize),
encryptionConfiguration: createEncryptionConfig(role, this.props.encryptionKey),
cloudWatchLoggingOptions: intermediateLoggingOptions,
compressionFormat: compression?.value,
};
const bucketAccessRole = this.props.bucketAccessRole ?? new iam.Role(scope, 'Intermediate Bucket Redshift Access Role', {
assumedBy: new iam.ServicePrincipal('redshift.amazonaws.com'),
});
if (!this.props.bucketAccessRole && cluster instanceof redshift.Cluster) {
cluster.attachRole(bucketAccessRole);
}
intermediateBucket.grantRead(bucketAccessRole);

const { loggingOptions: redshiftLoggingOptions, dependables: redshiftLoggingDependables } = createLoggingOptions(scope, {
logging: this.props.logging,
logGroup: this.props.logGroup,
role,
streamId: 'Redshift',
}) ?? {};
const { backupConfig, dependables: backupDependables } = createBackupConfig(scope, role, this.props.s3Backup) ?? {};

return {
redshiftDestinationConfiguration: {
clusterJdbcurl: jdbcUrl,
copyCommand: {
dataTableName: this.table.tableName,
dataTableColumns: this.table.tableColumns.map(column => column.name).join(),
copyOptions: copyOptions + (compression === Compression.GZIP ? ' gzip' : ''),
},
password: user.password.toString(),
username: user.username,
s3Configuration: intermediateS3Config,
roleArn: role.roleArn,
cloudWatchLoggingOptions: redshiftLoggingOptions,
processingConfiguration: createProcessingConfig(scope, role, this.props.processor),
retryOptions: this.createRetryOptions(retryTimeout),
s3BackupConfiguration: backupConfig,
s3BackupMode: this.getS3BackupMode(),
},
dependables: [...(intermediateLoggingDependables ?? []), ...(redshiftLoggingDependables ?? []), ...(backupDependables ?? [])],
};
}

private createRetryOptions(retryTimeout?: cdk.Duration): firehose.CfnDeliveryStream.RedshiftRetryOptionsProperty | undefined {
return retryTimeout ? {
durationInSeconds: retryTimeout.toSeconds(),
} : undefined;
}

private getS3BackupMode(): string | undefined {
return this.props.s3Backup?.bucket || this.props.s3Backup?.mode === BackupMode.ALL
? 'Enabled'
: undefined;
}
}
14 changes: 11 additions & 3 deletions packages/@aws-cdk/aws-kinesisfirehose-destinations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,32 +72,40 @@
"license": "Apache-2.0",
"devDependencies": {
"@aws-cdk/assertions": "0.0.0",
"@aws-cdk/aws-ec2": "0.0.0",
"@aws-cdk/aws-lambda-nodejs": "0.0.0",
"@types/jest": "^26.0.24",
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
"cfn2ts": "0.0.0",
"jest": "^26.6.3",
"pkglint": "0.0.0",
"@aws-cdk/aws-lambda": "0.0.0",
"@aws-cdk/aws-lambda-nodejs": "0.0.0"
"pkglint": "0.0.0"
},
"dependencies": {
"@aws-cdk/aws-iam": "0.0.0",
"@aws-cdk/aws-kinesisfirehose": "0.0.0",
"@aws-cdk/aws-kms": "0.0.0",
"@aws-cdk/aws-lambda": "0.0.0",
"@aws-cdk/aws-logs": "0.0.0",
"@aws-cdk/aws-redshift": "0.0.0",
"@aws-cdk/aws-s3": "0.0.0",
"@aws-cdk/aws-secretsmanager": "0.0.0",
"@aws-cdk/core": "0.0.0",
"@aws-cdk/custom-resources": "0.0.0",
"constructs": "^3.3.69"
},
"homepage": "https://github.com/aws/aws-cdk",
"peerDependencies": {
"@aws-cdk/aws-iam": "0.0.0",
"@aws-cdk/aws-kinesisfirehose": "0.0.0",
"@aws-cdk/aws-kms": "0.0.0",
"@aws-cdk/aws-lambda": "0.0.0",
"@aws-cdk/aws-logs": "0.0.0",
"@aws-cdk/aws-redshift": "0.0.0",
"@aws-cdk/aws-s3": "0.0.0",
"@aws-cdk/aws-secretsmanager": "0.0.0",
"@aws-cdk/core": "0.0.0",
"@aws-cdk/custom-resources": "0.0.0",
"constructs": "^3.3.69"
},
"engines": {
Expand Down
Loading