Skip to content

Commit

Permalink
feat: redshift example (#661)
Browse files Browse the repository at this point in the history
* example showing how to build a multi data warehouse platform on Redshift Serverless

---------

Co-authored-by: Jan Tan <jantan@amazon.com>
  • Loading branch information
vgkowski and jmgtan authored Jul 19, 2024
1 parent e951c74 commit 2ac4dc7
Show file tree
Hide file tree
Showing 25 changed files with 867 additions and 175 deletions.
3 changes: 3 additions & 0 deletions .projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 60 additions & 0 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,66 @@ const buildOpensearchQuickstartTask = opensearchQuickstart.addTask('build-exampl
});
opensearchQuickstart.packageTask.spawn(buildOpensearchQuickstartTask);

const redshiftDataWarehouseExample = new awscdk.AwsCdkPythonApp({
name: 'redshift-data-warehouse-example',
moduleName: 'stacks',
packageName: 'redshift-data-warehouse-example',
version: '0.0.1',
description: 'An example CDK app demonstrating the most common use cases for Data Solutions Framework on AWS',
authorName: author,
authorEmail: authorAddress,
license,

parent: rootProject,
outdir: 'examples/redshift-data-warehouse-example',

cdkVersion: CDK_VERSION,
constructsVersion: CDK_CONSTRUCTS_VERSION,
cdkVersionPinning: true,

pytest: true,
devDeps: [
"pytest",
`aws-cdk.lambda-layer-kubectl-${KUBECTL_LAYER_VERSION}`,
"black"
],
pythonExec: 'python3',
venvOptions: {
envdir: '.venv'
},
context: {
'@data-solutions-framework-on-aws/removeDataOnDestroy': true,
}
});

redshiftDataWarehouseExample.addGitIgnore('cdk.context.json');
redshiftDataWarehouseExample.removeTask('deploy');
redshiftDataWarehouseExample.removeTask('destroy');
redshiftDataWarehouseExample.removeTask('diff');
redshiftDataWarehouseExample.removeTask('watch');
redshiftDataWarehouseExample.removeTask('synth');
redshiftDataWarehouseExample.testTask.reset();
redshiftDataWarehouseExample.postCompileTask.reset();
redshiftDataWarehouseExample.addTask('test:unit', {
description: 'Run unit tests',
exec: 'pytest -k "not e2e"'
});
redshiftDataWarehouseExample.addTask('test:e2e', {
description: 'Run end-to-end tests',
exec: 'pytest -k e2e'
});

const redshiftDataWarehouseExampleSynthTask = redshiftDataWarehouseExample.tasks.tryFind('synth:silent')!;
redshiftDataWarehouseExampleSynthTask.reset();
redshiftDataWarehouseExampleSynthTask.exec(`npx aws-cdk@${CDK_VERSION} synth -q`);
const buildredshiftDataWarehouseExampleTask = redshiftDataWarehouseExample.addTask('build-example', {
steps: [
{ exec: `pip install --ignore-installed --no-deps --no-index --find-links ../../framework/dist/python cdklabs.aws_data_solutions_framework` },
{ spawn: 'synth:silent' },
{ spawn: 'test:unit' },
]
});
redshiftDataWarehouseExample.packageTask.spawn(buildredshiftDataWarehouseExampleTask);

rootProject.addTask('test:e2e', {
description: 'Run end-to-end tests'
Expand Down
11 changes: 11 additions & 0 deletions examples/redshift-data-warehouse-example/.gitattributes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

88 changes: 88 additions & 0 deletions examples/redshift-data-warehouse-example/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions examples/redshift-data-warehouse-example/.projen/deps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions examples/redshift-data-warehouse-example/.projen/files.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

115 changes: 115 additions & 0 deletions examples/redshift-data-warehouse-example/.projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2ac4dc7

Please sign in to comment.