A CDK Python app for deploying foundational infrastructure for InsuranceLake in AWS
Project description
InsuranceLake Infrastructure
Overview
This solution guidance helps you deploy extract, transform, load (ETL) processes and data storage resources to create InsuranceLake. It uses Amazon Simple Storage Service (Amazon S3) buckets for storage, AWS Glue for data transformation, and AWS Cloud Development Kit (CDK) Pipelines. The solution is originally based on the AWS blog Deploy data lake ETL jobs using CDK Pipelines.
The best way to learn about InsuranceLake is to follow the Quickstart guide and try it out.
The InsuranceLake solution is comprised of two codebases: Infrastructure and ETL.
Specifically, this solution helps you to:
- Deploy a "3 Cs" (Collect, Cleanse, Consume) architecture InsuranceLake.
- Deploy ETL jobs needed to make common insurance industry data souces available in a data lake.
- Use pySpark Glue jobs and supporting resoures to perform data transforms in a modular approach.
- Build and replicate the application in multiple environments quickly.
- Deploy ETL jobs from a central deployment account to multiple AWS environments such as Dev, Test, and Prod.
- Leverage the benefit of self-mutating feature of CDK Pipelines; specifically, the pipeline itself is infrastructure as code and can be changed as part of the deployment.
- Increase the speed of prototyping, testing, and deployment of new ETL jobs.
Contents
Architecture
This section explains the overall InsuranceLake architecture and the components of the infrastructure.
Collect, Cleanse, Consume
As shown in the figure below, we use S3 for storage, specifically three different S3 buckets:
- Collect bucket to store raw data in its original format.
- Cleanse/Curate bucket to store the data that meets the quality and consistency requirements for the data source.
- Consume bucket for data that is used by analysts and data consumers (for example, Amazon Quicksight, Amazon Sagemaker).
InsuranceLake is designed to support a number of source systems with different file formats and data partitions. To demonstrate, we have provided a CSV parser and sample data files for a source system with two data tables, which are uploaded to the Collect bucket.
We use AWS Lambda and AWS Step Functions for orchestration and scheduling of ETL workloads. We then use AWS Glue with PySpark for ETL and data cataloging, Amazon DynamoDB for transformation persistence, Amazon Athena for interactive queries and analysis. We use various AWS services for logging, monitoring, security, authentication, authorization, notification, build, and deployment.
Note: AWS Lake Formation is a service that makes it easy to set up a secure data lake in days. Amazon QuickSight is a scalable, serverless, embeddable, machine learning-powered business intelligence (BI) service built for the cloud. Amazon DataZone is a data management service that makes it faster and easier for customers to catalog, discover, share, and govern data stored across AWS, on premises, and third-party sources. These three services are not used in this solution but can be added.
Infrastructure
The figure below represents the infrastructure resources we provision for the data lake.
- S3 buckets for:
- Collected (raw) data
- Cleansed and Curated data
- Consume-ready (prepared) data
- Server access logging
- Optional Amazon Virtual Private Cloud (Amazon VPC)
- Subnets
- Security groups
- Route table(s)
- Amazon VPC endpoints
- Supporting services, such as AWS Key Management Service (KMS)
Codebase
Source Code Structure
The table below explains how this source code is structured.
File / Folder | Description |
---|---|
app.py | Application entry point |
code_commit_stack.py | Optional stack to deploy an empty CodeCommit respository for mirroring |
pipeline_stack.py | CodePipeline stack entry point |
pipeline_deploy_stage.py | CodePipeline deploy stage entry point |
s3_bucket_zones_stack.py | Stack to create three S3 buckets (Collect, Cleanse, and Consume), supporting S3 bucket for server access logging, and KMS Key to enable server side encryption for all buckets |
vpc_stack.py | Stack to create all resources related to Amazon VPC, including virtual private clouds across multiple availability zones (AZs), security groups, and Amazon VPC endpoints |
test | This folder contains pytest unit tests |
resources | This folder has static resources such as architecture diagrams |
Automation scripts
The table below lists the automation scripts to complete steps before the deployment.
Script | Purpose |
---|---|
bootstrap_deployment_account.sh | Used to bootstrap deployment account |
bootstrap_target_account.sh | Used to bootstrap target environments for example dev, test, and production |
configure_account_secrets.py | Used to configure account secrets for GitHub access token |
Authors
The following people are involved in the design, architecture, development, testing, and review of this solution:
- Cory Visi, Senior Solutions Architect, Amazon Web Services
- Ratnadeep Bardhan Roy, Senior Solutions Architect, Amazon Web Services
- Jose Guay, Enterprise Support, Amazon Web Services
- Isaiah Grant, Cloud Consultant, 2nd Watch, Inc.
- Muhammad Zahid Ali, Data Architect, Amazon Web Services
- Ravi Itha, Senior Data Architect, Amazon Web Services
- Justiono Putro, Cloud Infrastructure Architect, Amazon Web Services
- Mike Apted, Principal Solutions Architect, Amazon Web Services
- Nikunj Vaidya, Senior DevOps Specialist, Amazon Web Services
License Summary
This sample code is made available under the MIT-0 license. See the LICENSE file.
Copyright Amazon.com and its affiliates; all rights reserved. This file is Amazon Web Services Content and may not be duplicated or distributed without permission.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file aws_insurancelake_infrastructure-4.1.2.tar.gz
.
File metadata
- Download URL: aws_insurancelake_infrastructure-4.1.2.tar.gz
- Upload date:
- Size: 21.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c103d73b4a621999a6d465f702a6e48f4e4374f2d301df89cf5d26e44edf7d7 |
|
MD5 | 796f078e6130ddd509009f715947fd25 |
|
BLAKE2b-256 | 4630606fc4e49ef671c9f7338eb67577654d172c5eec1cd76e50bf8dbea712e0 |
File details
Details for the file aws_insurancelake_infrastructure-4.1.2-py3-none-any.whl
.
File metadata
- Download URL: aws_insurancelake_infrastructure-4.1.2-py3-none-any.whl
- Upload date:
- Size: 22.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83aad4160a14394654be644829b0ac3576fe0b5dcac3a550f9e9114cbb8eef6b |
|
MD5 | a3b71c6e4988e25e65557070d7e1f0ed |
|
BLAKE2b-256 | c43e0cc797ec368dc28d5526b60b5ae7ce84789c3feeaefd8f308e497985bb64 |