This document summarizes CI/CD on AWS by Bhargav Amin. It introduces DevOps practices like continuous integration, continuous delivery, and continuous deployment. It explains how to design a CI/CD pipeline and create one on AWS using services like CodeCommit, CodeBuild, CodeDeploy, and CodePipeline. The document provides examples of integrating these services to automate building, testing, and deploying code changes. It also includes a link to a demo repository and discusses managing infrastructure with CI/CD by updating CloudFormation templates in a pipeline.
2. About me
• Tech Blogger (http://bhargavamin.com)
• 30,000+ views / 17,000+ visitors
• 27+ articles top ranked articles on Google Search
• 90+ tech articles
• AWS Certified SA
• Owner - DevOps and Security at Entytle Inc
• Manage Infrastructure including DevOps framework
• Travel vlogger
3. Agenda
Introduction to DevOps
Understanding DevOps practices
Designing a CI/CD pipeline
Creating a CI/CD pipeline on AWS
Feel free to ask question any time.
5. DevOps the term
• Making software development cycle more efficient
• Bridging gap between Development and Operations
A combination of :
• Cultural philosophies
• Best/well-known Practices
• Tools
Deliver application and services at higher velocity.
7. CI/CD
• Continuous Integration and Delivery/Deployment
• Continually build, test and deploy
• Find and address bugs quickly
• Work on multiple things parallel
• Ship code often in small chunks
11. Continuous Integration (CI)
Continuous Integration
• A process which allows multiple
developers to work on same
code/repository simultaneously while
making sure that the integrity of code is
maintained.
The key goals
• Find and address bugs more quickly
• Improve software quality
• Overall reduce the time taken to
validate and release new software
updates.
13. Continuous Delivery (CD)
A software development process where code changes are
automatically…
Built
Tested
Prepared for release
CD integrates with CI
Helps deploy code changes
It takes up delivery and deployment tasks once build is complete
Workflow process
Fully automated
Partially automated – Includes manual steps at certain stage
14. Continuous Deployment
It is totally different from Continuous Delivery.
Continuous delivery includes
• Decision making
• Authorization
Continuous deployment is about
• Deploy everything once the test are succeeded
• No approval, fully automated
Suitable for testing environments, not production
16. CI/CD on AWS
Developers
commits changes
Changes
are built
Code is deployed
and tested
Changes deployed to
production
environment
CodeBuildCodeCommit
CodeDeploy
Jenkins
Solano CI
Cloudformation
Opsworks
Elastic
Beanstalk
19. CodePipeline
• Setup and Automate release process
• Use tools/services as every stage
• View whole process at-a-glance
• Add. Features like:
• Custom action and manual approvals
Speed up delivery
while improving quality
Source Build Test Release
Developers Customer
Feedbacks/Requests
21. CodeCommit
• Equivalent to GitHub, Bitbucket and GitLab
• Fully managed version control service
• Support Git standard (same commands)
• No limit on repos and file size
• Dead cheap ($ 1 per active user)
22. CodeBuild
• Fully managed build service
• Run concurrent builds at same time/scalable
• Pre-configured environments
• Build from CodeCommit,Github,Bitbucket,S3
• Build using an EC2 instance or Docker image
• Build-as-a-code using buildspec.yaml
24. CodeDeploy
• Automate deployments
• Provides highly available deployment options:
• Blue/Green deployment
• In-place deployment
• Has an option to Stop or Roll back updates
• Deployment-as-a code using appspec.yaml
27. Application level CI/CD
CodeBuild CodeDeploy Group of Instances
Developers
Source
Repository
1. Developers
commits code to
Git Repo
CodePipeline
28. Application level CI/CD
CodeBuild CodeDeploy Group of Instances
Developers
Source
Repository
1. Developers
commits code to
Git Repo
2. Polls Git repo
for changes
Store Artifacts on
Bucket
CodePipeline
29. Application level CI/CD
CodeBuild CodeDeploy Group of Instances
Developers
Source
Repository
1. Developers
commits code to
Git Repo
2. Polls Git repo
for changes
3. Picks up artifact from
CodeBuild, deploy them to
Instances
CodePipeline
30. Continuous Delivery
CodeBuild CodeDeploy Group of Instances
Developers
Source
Repository
1. Developers
commits code to
Git Repo
2. Polls Git repo
for changes
4. Picks up artifact from
CodeBuild, deploy them to
Instances
CodePipeline
3. Delivered, awaiting for
manual approval
Manual
Approval
31. Continuous Deployment
CodeBuild CodeDeploy Group of Instances
Developers
Source
Repository
1. Developers
commits code to
Git Repo
2. Polls Git repo
for changes
3. Picks up artifact from
CodeBuild, deploy them to
Instances
CodePipeline
NO APPROVAL, FULLY AUTOMATED
32. Repo link for the demo
Visit : https://bhargavamin.github.io/devops-techtalk
It also includes step-by-step guide to setup CI/CD pipeline for both the demo
34. Manage Infrastructure using CI/CD
Bucket
CodePipeline Create stack Delete stack
Approve
stack
Test environment
Production environment
Create
Change Set
Execute
Change SetApprove
stack
1. Updated CF
template
DevOps
2. Upload CF
changes to S3
bucket
3. The changes on S3
bucket triggers
Pipeline execution
4. CP will create a
Test stack
5. After testing,
manual approval
is required
6. Changes are
incorrect or has
issues, the stack will
be deleted
7. If changes are
approved, A
production stack
will be created.
8. Once approved,
The change set will
be deployed prod
env
MA- Take whole code deploy whole thing together, if one thing fails- deployment fails
Micro- Divide a software/product, makes it easy to manage by smaller teams, ownership, focused approach, faster delivery/updates, no centralized change management
IAC- Automate static stacks, actions as code, easily manage versions, quick to deploy with systematic approach
For major stages for software delivery
For major stages for software delivery
For major stages for software delivery
For major stages for software delivery
With CodeDeploy, you can choose the specific settings for your blue/green deployments. For example, you can choose to manually provision the new instances or let CodeDeploy provision them for you by copying an existing Auto Scaling group. You can also choose when to reroute traffic to the new instances, the rate at which traffic is routed to them, and whether to terminate your old instances upon completion.
Agent looks for a instruction file which resides in root of your source