@randyridgley/cdk-datalake-constructs
TypeScript icon, indicating that this package has built-in type declarations

0.0.64 • Public • Published

cdk-datalake-constructs

Very experimental until version 1.0. This is my attempt at simplifying deploying various datalake strategies in AWS with the CDK.

License
Build Release Python pip
npm version pypi version Maven nuget

Table of Contents

Features

  • Easy to Start - Create a Datalake in a few lines.
  • Easy to Expand - Expand into multiple accounts and into a data mesh.
  • Easy to Admin - Initial governance created on deploy.

Installation

TypeScript/JavaScript

$ npm install @randyridgley/cdk-datalake-constructs

Python

$ pip install cdk-datalake-constructs

.Net

$ nuget install CDK.Datalake.Constructs

# See more: https://www.nuget.org/packages/CDK.Datalake.Constructs/

Usage

Basic

import { DataLake } from '@randyridgley/cdk-datalake-constructs';

const taxiPipes: Array<dl.Pipeline> = [
  pipelines.YellowPipeline(),
  pipelines.GreenPipeline(),
]

const dataProducts: Array<dl.DataProduct> = [{
  pipelines: taxiPipes,
  accountId: lakeAccountId,
  dataCatalogAccountId: '123456789012',
  databaseName: 'taxi-product'
}]

// deploy to local account
new dl.DataLake(this, 'LocalDataLake', {
  name: 'data-lake',
  accountId: centralAccountId,
  region: 'us-east-1',
  policyTags: {
    "classification": "public,confidential,highlyconfidential,restricted,critical",
    "owner": "product,central,consumer"
  },
  stageName: Stage.PROD,
  dataProducts: dataProducts,
  createDefaultDatabase: false
});

Data Mesh

You can setup cross account access and pre-created policy tags for TBAC access in Lake Formation

const lakeAccountId = app.node.tryGetContext('lakeAccountId')
const centralAccountId = app.node.tryGetContext('centralAccountId')
const consumerAccountId = app.node.tryGetContext('consumerAccountId')

const taxiPipes: Array<dl.Pipeline> = [
  pipelines.YellowPipeline(),
  pipelines.GreenPipeline(),
]

const dataProducts: Array<dl.DataProduct> = [{
  pipelines: taxiPipes,
  accountId: lakeAccountId,
  dataCatalogAccountId: centralAccountId,
  databaseName: 'taxi-product'
}]

// deploy to the central account
new dl.DataLake(this, 'CentralDataLake', {
  name: 'central-lake',
  accountId: centralAccountId,
  region: 'us-east-1',
  policyTags: {
    "classification": "public,confidential,highlyconfidential,restricted,critical",
    "owner": "product,central,consumer"
  },
  stageName: Stage.PROD,
  crossAccount: {
    consumerAccountIds: [consumerAccountId, lakeAccountId],
    dataCatalogOwnerAccountId: centralAccountId,
    region: 'us-east-1', // this is still only single region today    
  },
  dataProducts: dataProducts,
  createDefaultDatabase: true
});

// deploy to the data product account
const datalake = new dl.DataLake(this, 'LocalDataLake', {
  name: 'local-lake',
  accountId: lakeAccountId,
  region: 'us-east-1',
  stageName: Stage.PROD,
  dataProducts: dataProducts,
  createDefaultDatabase: true
});

// Optionally add custom resource to download public data set products
datalake.createDownloaderCustomResource(accountId, region, props.stageName)

// deploy to consumer account
const datalake = new dl.DataLake(this, 'ConsumerDataLake', {
  name: 'consumer-lake',
  accountId: consumerAccountId,
  region: 'us-east-1',
  stageName: Stage.PROD,
  policyTags: {
    "access": "analyst,engineer,marketing"
  },
  createDefaultDatabase: true
});

Documentation

Construct API Reference

See API.md.

Supporting this project

I'm working on this project in my free time, if you like my project, or found it helpful and would like to support me any contributions are much appreciated! ❤️

License

This project is distributed under the MIT.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.647latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.647
0.0.630
0.0.620
0.0.610
0.0.600
0.0.590
0.0.580
0.0.570
0.0.560
0.0.550
0.0.540
0.0.530
0.0.520
0.0.510
0.0.500
0.0.490
0.0.480
0.0.470
0.0.460
0.0.450
0.0.440
0.0.430
0.0.420
0.0.410
0.0.400
0.0.390
0.0.380
0.0.370
0.0.360
0.0.350
0.0.340
0.0.330
0.0.320
0.0.310
0.0.300
0.0.290
0.0.280
0.0.270
0.0.260
0.0.250
0.0.240
0.0.230
0.0.220
0.0.210
0.0.200
0.0.190
0.0.180
0.0.170
0.0.160
0.0.150
0.0.140
0.0.130
0.0.120
0.0.110
0.0.100

Package Sidebar

Install

npm i @randyridgley/cdk-datalake-constructs

Weekly Downloads

7

Version

0.0.64

License

MIT

Unpacked Size

1.29 MB

Total Files

58

Last publish

Collaborators

  • randyridgley