We use both Bamboo and AWS. Making those two work together is really a amazing thing for DevOps. In this blog, I am going to talk about my favorite bamboo plan that supports quick build, hot code deployment and blue/green deployment.
We name such Bamboo plan as AWS pipeline, as it is only used for AWS stack build, code deployment. And it require a bunch of AWS services: Cloudformation, EC2 ( ELB, Autoscaling group, SSM agent), S3, DynamoDB, Router 53.
Let’s start with two terms: Stack and Version. Stack means the infrastructure, from EC2 instance, ELB, autoscaling group to the binaries (kernel and applications). Version is the release number. Both stack and code have versions. You should see one benefit already – binaries and codes are decoupled.
Like other Bamboo plans, AWS pipeline includes build and deployment two sub plans
Build plan is for checking out and building the codes, optionally you can bake a new AMI if you want to create a new stack later in the deployment plan.
Deployment is for building a new stack, deploying code to stack, updating floating dns (for blue/green deployment), deleting the old stack and promoting release.
With above in mind, now we can have a look at the high level design.
- The baked AMI is used for creating the new stack.
- The new stack get the code release number from the dynamodb.
- Download the code from S3 bucket.
- (Optional) Update floating dns to point to the new stack.
In the next post, I will explain more about the build plan. Especially, how to quickly bake a AMI.