Training Course
Amazon Web Service
8/9/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 1
Module 11:
CI/CD With AWS
8/9/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 2
Module 11: CI/CD With AWS
Goal: Understanding CI/CD Services in AWS
AWS CodePipeline
AWS CodeCommit
AWS CodeBuild
AWS CodeDeploy
Deployment Strategies
Prerequisites:
CI/CD And Devops Related Knowledge
Containerization
Lab: Create and configure CodePipeline Deploy on ECS
8/9/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 3
Module 11: CI/CD With AWS
Introduction
• CI/CD stands for Continuous Integration and Continuous Deployment. It
is a software development practice that involves automatically building,
testing, and deploying code changes to various environments.
• Continuous Integration (CI) refers to the practice of merging code
changes into a shared repository multiple times a day. Automated
testing is run on the code changes to ensure they do not break the
build.
• Continuous Deployment (CD) refers to the practice of automatically
deploying code changes to various environments such as development,
staging and production.
8/9/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 4
Module 11: CI/CD With AWS
Introduction
• The goal of CI/CD is to catch and fix errors early in the development
process, reduce lead time and provide faster feedback to the
development team.
• Implementing CI/CD can improve the quality of the code and reduce the
risk of introducing bugs, improve the collaboration and communication
between developers and reduce the time it takes to deliver new
features.
8/9/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 5
Module 11: CI/CD With AWS
Introduction
8/9/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 6
Module 11: CI/CD With AWS
Introduction
• Code SVM: AWS CodeCommit
• CI: AWS CodeBuild
• CD: AWS CodeDeploy
• Artifact Storage: AWS CodeArtifact
• Orchestrate Pipeline: AWS CodePipeline
8/9/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 7
Module 11: CI/CD With AWS
AWS CodeCommit
• CodeCommit is a fully-managed source control service that makes it
easy for companies to host their Git repositories in the cloud.
• With CodeCommit, you can store your source code and other assets in
a private, secure, and highly available repository.
• CodeCommit supports all Git features such as branching, merging, and
pull requests.
• You can access the repositories from anywhere and collaborate with
your team using IAM permissions.
8/9/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 8
Module 11: CI/CD With AWS
AWS CodeCommit
• CodeCommit also integrates with other AWS services such as
CodeBuild, CodeDeploy, and CodePipeline to provide a seamless
CI/CD experience.
• To create a new repository on CodeCommit, you can use the AWS
Management Console, the AWS CLI, or the CodeCommit API.
• You can also import existing Git repositories from other sources such as
GitHub, Bitbucket, or a local file system.
• CodeCommit also provides a number of security features such as
encryption at rest, integration with IAM and KMS, and the ability to audit
repository access using CloudTrail.
8/9/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 9
Module 11: CI/CD With AWS
AWS CodeCommit
8/9/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 10
Module 11: CI/CD With AWS
AWS CodeBuild
• CodeBuild is a fully-managed build service that compiles source code,
runs tests, and produces software packages that are ready for
deployment.
• CodeBuild allows you to build various types of applications such as
Java, .NET, Ruby, Go, and more. It also supports building container
images using Docker.
• CodeBuild can be configured to run on a schedule, in response to a
code change, or as part of a pipeline in CodePipeline.
• CodeBuild uses build environments, which are pre-configured with
specific versions of programming languages, tools, and frameworks.
8/9/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 11
Module 11: CI/CD With AWS
AWS CodeBuild
• You can also create custom build environments to meet specific
requirements.
• CodeBuild integrates with other AWS services such as CodeCommit,
CodeDeploy, and CodePipeline to provide a seamless CI/CD
experience.
• CodeBuild also provides detailed logs, metrics, and notifications to
help you troubleshoot and optimize your builds.
• For security, CodeBuild integrates with IAM, so you can control access
to the build environments and the artifacts produced by the builds.
8/9/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 12
Module 11: CI/CD With AWS
AWS CodeBuild
• buildspec.yaml file:
• Can place in the code repository or in the configuration of that code
build.
• This is a yaml file (the purpose of this file is similar to jenkins file
• This file is used for instructing CodeBuild on how to build the
project (using script code)
8/9/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 13
Module 11: CI/CD With AWS
AWS CodeBuild
buildspec.yaml
file example
8/9/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 14
Module 11: CI/CD With AWS
Deployment Strategy
8/9/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 15
Module 11: CI/CD With AWS
Deployment Strategy
• Recreate:
8/9/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 16
Module 11: CI/CD With AWS
Deployment Strategy
• Ramped/Rolling Update:
8/9/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 17
Module 11: CI/CD With AWS
Deployment Strategy
• Blue/Green:
8/9/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 18
Module 11: CI/CD With AWS
Deployment Strategy
• Canary:
8/9/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 19
Module 11: CI/CD With AWS
Deployment Strategy
• A/B Testing:
A subset of user is
routed to the version 2
8/9/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 20
Module 11: CI/CD With AWS
AWS CodeDeploy
• CodeDeploy is a fully-managed deployment service that automates
software deployments to a variety of compute services such as Amazon
EC2, AWS Fargate, AWS Lambda, and on-premises servers.
• CodeDeploy can be used to deploy new versions of an application or to
update the configuration of an existing application.
• CodeDeploy supports both in-place and blue/green deployment strategies,
which allows for minimal downtime during deployment.
8/9/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 21
Module 11: CI/CD With AWS
AWS CodeDeploy
• CodeDeploy also integrates with other AWS services such as
CodeCommit, CodeBuild, and CodePipeline to provide a seamless CI/CD
experience.
• CodeDeploy also provides detailed logs, metrics, and notifications to help
you troubleshoot and optimize your deployments.
• CodeDeploy also integrates with IAM, so you can control access to the
deployment groups and the instances in the deployment group.
8/9/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 22
Module 11: CI/CD With AWS
AWS CodePipeline
• CodePipeline is a fully-managed continuous
delivery service that helps automate the
release pipeline for fast and reliable
application and infrastructure updates.
• CodePipeline enables you to design and
visualize your release pipeline, and automate
the steps required to release your software.
8/9/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 23
Module 11: CI/CD With AWS
AWS CodePipeline
• CodePipeline allows you to integrate with other AWS services such as
CodeCommit, CodeBuild, and CodeDeploy, as well as third-party
services like GitHub and Jenkins.
• CodePipeline supports multiple stages and actions, such as building,
testing, and deploying your code.
8/9/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 24
Module 11: CI/CD With AWS
AWS CodePipeline
• CodePipeline also supports automatic rollbacks in case of a failure
during deployment
• CodePipeline also provides detailed logs, metrics, and notifications to
help you troubleshoot and optimize your pipelines.
• CodePipeline also integrates with IAM, so you can control access to
the pipeline, stages, and actions.
8/9/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 25
Module 11: CI/CD With AWS
AWS CodePipeline
• CodePipeline example design architecture:
Note: CodePipeline can
deploy cross-account
(more advanced with
lots of configuration
needed)
8/9/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 26
Module 11 : CI/CD With AWS
Thank you!!!
8/9/2023 09e-BM/DT/FSOFT - ©FPT SOFTWARE – Fresher Academy - Internal Use 27