Home
Softono
aws-cdk-starter

aws-cdk-starter

Open source Java
33
Stars
7
Forks
1
Issues
1
Watchers
5 years
Last Commit

About aws-cdk-starter

aws-cdk-starter is a collection of reusable CDK stacks built by Vladimir Budilov to automate AWS resource provisioning across multiple services. Designed to standardize deployments that previously used a mix of Serverless, SAM, and Terraform, it focuses on building a data ingestion application using Kinesis, EKS, DynamoDB, and other AWS services. Current stacks include Cognito with Lambda triggers, DynamoDB tables for users and tickers, an Elasticsearch service with associated IAM roles, a Kinesis stream, an ECS Fargate service with IAM roles, ECR repositories, and Parameter Store integration for endpoint discovery. An S3 bucket for SPA hosting is planned. Deployment requires Java/Maven for building and the AWS CDK CLI for synthesis and deployment. Users first run mvn package and cdk synth after code changes, then cdk bootstrap once per account, followed by deploying the ECR stack to create a repository for container images, pushing a Docker image, and finally deploying the remaining stacks including DynamoDB

Platforms

Web Self-hosted Cloud

Languages

Java

Links

Collection of useful CDK Stacks

Author: Vladimir Budilov

drawing

Why

I create apps and deployments all of the time. I use different tools for different scenarios. Sometimes I use the Serverless framework to deploy Lambda functions, sometimes SAM. In some cases I used Terraform to create other resources, and it others I just did it manually. This project is going to help me (and hopefully you) to automate some of those resource creations.

The idea is to build out an app (details will come later) that facilitates data ingestion using Kinesis, EKS, DDB, and other popular AWS services.

What does it do now

  • [x] Cognito Stack
  • [x] Cognito Stack Lambda Triggers
  • [x] DynamoDB Users & Ticker Table
  • [x] ElasticSearch service
  • [x] IAM role to access Elasticsearch
  • [x] Kinesis Stream
  • [x] ECS Fargate Service
  • [x] ECS Fargate Service IAM roles
  • [x] ECR Repos
  • [x] Saving endpoints into the Parameter Store (for discovery)
  • [ ] S3 Bucket (for SPA hosting)

Deployment

# You'll need to package and syth every time you make code changes
mvn package && cdk synth

# this step should be done once, but only after your first 'mvn package'
cdk bootstrap

# After the code is built and cdk synth is run, deploy to your account
# first create the ECR stack. After this step is created make sure you deploy
# a valid docker image to the 'data-ingest-gateway' repo, otherwise the ECS stack
# won't deploy (it'll wait for a valid image to show up in that ECR repo)
cdk deploy "TickerEcrStack"

# Then deploy all of the other Stacks
cdk deploy "TickerDDBTables"
cdk deploy "TickerKinesisStreams"
cdk deploy "TickerCognitoLambdaStack"
cdk deploy "TickerCognitoUP"
cdk deploy "TickerESIAM"
cdk deploy "TickerES"
cdk deploy "TickerEcsIamStack"
cdk deploy "TickerEcsStack"
Useful commands
  • mvn package compile and run tests
  • cdk ls list all stacks in the app
  • cdk synth emits the synthesized CloudFormation template
  • cdk deploy deploy this stack to your default AWS account/region
  • cdk diff compare deployed stack with current state
  • cdk docs open CDK documentation