# Examples
This folder contains 4 different examples how AutoCanary24 can be used. You should have set the AWS credentials before you execute them.
## 1) Switch complete stacks at once not keeping the inactive stack
How to run: `rake sample_1`
| Steps | |
| :------------- | :------------- |
| Initial state: All the traffic goes to blue stack | |
| Green stack is created | |
| Green stack gets all the traffic | |
| Blue stack will be deleted | |
## 2) Switch complete stacks at once keeping the inactive stack
How to run: `rake sample_2`
| Steps | |
| :------------- | :------------- |
| Initial state: All the traffic goes to blue stack | |
| Green stack is created | |
| Green stack gets all the traffic. Blue stack will not be deleted | |
## 3) Switch incrementally the stacks keeping the inactive stack
How to run: `rake sample_3`
| Steps | |
| :------------- | :------------- |
| Initial state: All the traffic goes to blue stack | |
| Green stack gets some traffic | |
| Green stack gets more traffic | |
| Green stack gets even more traffic | |
| Final state: All the traffic goes to green stack | |
## 4) Switch incrementally the stacks and rollback
How to run: `rake sample_4`
| Steps | |
| :------------- | :------------- |
| Initial state: All the traffic goes to blue stack | |
| Green stack is created | |
| Green stack gets some traffic | |
| Green stack gets more traffic | |
| Rollback: All the traffic goes again to blue stack | |
## 5) Switch complete stacks at once and roll back when health check fails
How to run: `rake sample_5`
| Steps | |
| :------------- | :------------- |
| Initial state: All the traffic goes to blue stack | |
| Green stack is created | |
| Green stack gets all the traffic. Blue stack will not be deleted | |
| The health check fails | |
| Rollback: All the traffic goes again to blue stack | |
## 6) Switch complete stacks at once and clean up when health check succeeds
How to run: `rake sample_6`
| Steps | |
| :------------- | :------------- |
| Initial state: All the traffic goes to blue stack | |
| Green stack is created | |
| Green stack gets all the traffic. Blue stack will not be deleted | |
| The health check succeeds | |
| Blue stack will be deleted | |