Skip to content

AWS CDK stacks for modernizing and containerizing "traditional" monolith projects, such as Drupal, WordPress, Laravel, Django, Flask or site generators.

License

Notifications You must be signed in to change notification settings

wwwpro/baws-cdk-monolith

Repository files navigation

Baws "Monolith" CDK - Beta

Use CDK command line to build and manage complete infrastructure needed to containerize and modernize your monolith applications such as WordPress, Drupal, Flask, Django, any static site generator with Docker and CodePipelines

This is currently an alpha build. More documentation and features arriving by October, 2019.

Getting Started


Important Note:

Although usage of this code is free, following instructions here will result in billable services in your AWS account.

You are responsbile for your AWS bill.

Prerequisites:

Setup


  1. Clone repo to local environment.
  2. Run npm i -g aws-cdk
  3. Run npm install
  4. Copy .cdk.json into a new file called cdk.json.
  5. Copy config.sample.yml to config.yml
  6. Follow configuration steps below

Configure cdk.json

bastionIps: (Optional) An array of IPs you'd like to be allowed to access EC2 instances.

SSLCertArn: (Required)T he Arn of the default SSL certificate you'd like to be added

ec2Key: Create (or upload) and SSH key to Key Pairs in the AWS console.

Configure.yml

Config.yml can be used to configure and update your infrastructure. Every variable option within this package can and should be updated here. Every array can be duplicated to create additional infrastructure. For instance, additional ECS clusters, additional tasks, additional pipelines, etc. can be created by duplicating the array.

All name options must be unique per array.

Most options are commented or self-explanatory. Additional documentation will be arriving by October, 2019.

Usage


After setup above, build the code locally:

npm run build

Then run the following command:

cdk bootstrap

After the bootstrap command is run, you have the option of 3 different stacks:

Creating your Stacks

cdk deploy stack-full

The above will launch all standard features, and launch an Aurora Cluster, and a Cache Cluster.

cdk deploy stack-standard

The above will launch all standard features for a CRUD application. It is missing elasticache when compared to stack-full.

cdk deploy stack-min

The above will not launch an Aurora (MySQL) cluster, or a cache cluster, compared to stack-full and stack-standard, respectively.

Destroying your Stacks

Each stack you create above is compiled from a serires of separate stacks. This is by design, in order to be able to destroy a service, for instance, without destroying its corresponding repo.

To view all stacks created by the services visit the CloudFormation Service in your console.

Destroying a stack will also destroy all service dependent on that stack. For instance, nearly every service is dependent on the vpc stack. To destroy everything created by the above deploy commands, run:

cdk destroy vpc

PLEASE NOTE: After populating storage and services with content, not every stack will destroy successfully. For instance, non-empty S3 buckets cannot be destroyed through command line; the destroy command will fail.

To destroy any stacks which fail to delete, you may have to take manual action, such as deleting the desired S3 buckets through the console, first.

Road Map


The following features have the highest priority in future implementation:

  • Blue/Green Deployment option in the pipeline.
  • Granular scaling options for services
  • Better scaling options for the scaling stack
  • Github support in pipelines.
  • "Files" support for S3, CDN and Pipeline configs, similar to ECS, so yml files can be read from a directory instead of needing to be in the main config.
  • Fargate Stack for deploying common utilities, such as PhpMyAdmin.

Contact


[email protected]

About

AWS CDK stacks for modernizing and containerizing "traditional" monolith projects, such as Drupal, WordPress, Laravel, Django, Flask or site generators.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published