rlaneve / aws-cdk

AWS CDK project template for Asp.net Core web API in AWS EB + RelationDB

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AWS CDK TypeScript project template!

AWS resources provisioned by using AWS CDK. AWS CDK is a "software development framework for defining cloud infrastructure in code and provisioning it through AWS CloudFormation" aka Infrastructure as Code (IaC).

This is an project template for an app with multiple stacks. It supports:

  1. Multi regions and multi aws accounts. Prod environment may be deployed to a different AWS (sub) account for higher resource isolation
  2. With cost optimizations (ex: no NAT Gateways are needed in a test environment as database & applicational layer is public accessible)
  3. Network stack with public (ex: for load balanceds), private (ex: for servers) and isolated (ex: for databases) subnets
  4. Compute stack based on latest version of .NET Core on Linux platform for AWS Elastic Beanstalk. Suitable to run Asp.net Core web projects and easily changeable to support a different AWS EB platform
  5. Database stack AWS RDS Aurora Postgres DB placed in Isolated subnet for production but accessible from application subnet
  6. Authentication stack for AWS Cognito setup
  7. Users stack for applicational AWS IAM users (programatic access)
  8. Storage stack for a single AWS S3 bucket

Getting started

  1. Set app:XXX context variables with your own values on cdk.json file
  2. Rename project name in package.json file
  3. Create a aws-elasticbeanstalk-ec2-role & aws-elasticbeanstalk-service-role. Tip: AWS EB create those roles automatically if you can an example app.
  4. Bootstrap cdk. The cdk.json file tells the CDK Toolkit how to execute your app.

The cdk.json file tells the CDK Toolkit how to execute your app.

Useful commands

  • npm run build compile typescript to js
  • npm run watch watch for changes and compile
  • npm run test perform the jest unit tests
  • cdk deploy deploy this stack to your default AWS account/region
  • cdk diff compare deployed stack with current state
  • cdk synth emits the synthesized CloudFormation template

About

AWS CDK project template for Asp.net Core web API in AWS EB + RelationDB


Languages

Language:TypeScript 53.2%Language:HTML 38.9%Language:JavaScript 7.9%