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:
- Multi regions and multi aws accounts. Prod environment may be deployed to a different AWS (sub) account for higher resource isolation
- With cost optimizations (ex: no NAT Gateways are needed in a test environment as database & applicational layer is public accessible)
- Network stack with public (ex: for load balanceds), private (ex: for servers) and isolated (ex: for databases) subnets
- 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
- Database stack AWS RDS Aurora Postgres DB placed in Isolated subnet for production but accessible from application subnet
- Authentication stack for AWS Cognito setup
- Users stack for applicational AWS IAM users (programatic access)
- Storage stack for a single AWS S3 bucket
- Set app:XXX context variables with your own values on
cdk.json
file - Rename project name in
package.json
file - Create a aws-elasticbeanstalk-ec2-role & aws-elasticbeanstalk-service-role. Tip: AWS EB create those roles automatically if you manually start an example app.
- Bootstrap cdk. The
cdk.json
file tells the CDK Toolkit how to execute your app.
npm run build
compile typescript to jsnpm run watch
watch for changes and compilenpm run test
perform the jest unit testscdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk synth
emits the synthesized CloudFormation template