Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sebsto/cdk-load-balance-autoscaling-groups
CDK Example Code to deploy Load Balanced Scaling Groups
https://github.com/sebsto/cdk-load-balance-autoscaling-groups
Last synced: 6 days ago
JSON representation
CDK Example Code to deploy Load Balanced Scaling Groups
- Host: GitHub
- URL: https://github.com/sebsto/cdk-load-balance-autoscaling-groups
- Owner: sebsto
- Created: 2019-10-06T13:10:09.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-04-10T09:16:21.000Z (over 1 year ago)
- Last Synced: 2023-05-19T00:10:15.709Z (over 1 year ago)
- Language: HTML
- Size: 514 KB
- Stars: 15
- Watchers: 2
- Forks: 12
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Create a Load Balancer and two AutoScaling Group
This code creates an [Application Load Balancer](https://docs.aws.amazon.com/en_pv/elasticloadbalancing/latest/application/application-load-balancer-getting-started.html) and Two [Auto Scaling groups](https://docs.aws.amazon.com/en_pv/autoscaling/ec2/userguide/AutoScalingGroup.html). It serves as basis to configure blue / green deployments.
## Getting started
### Initial tasks (to execute only once)
- Install CDK : https://docs.aws.amazon.com/en_pv/cdk/latest/guide/getting_started.html
```bash
npm install -g aws-cdk
```- Bootstrap the CDK environment
```bash
cdk boostrap
```### For each redeployment
- Build the code
```bash
npm run build
```- Deploy the code
```bash
cdk deploy
```### Cleanup
To cleanup the environment when you are done testing :
```bash
cdk destroy
```## Application versions
The sample app is a sample static HTML page, taken from [Boostrap's sample](https://getbootstrap.com/docs/4.0/examples/carousel/). Two versions of the same app are deployed. The blue version is deployed to the blue scaling group and the green version is deployed to the green group.
## 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