Professional Documents
Culture Documents
DevOps Culture
Dev Ops
3
4
Dev
Wall of Confusion
Ops
Development + Operations = DevOps
Dev Ops
5
What is DevOps?
• DevOps is a combination of:
• Cultural philosophies
• Practices
• Tools
6
DevOps Culture
• Dev & Ops coming together
• No more “silos”
• Shared responsibility
• Ownership
• Visibility and communication
7
DevOps Practices
• Microservices
• Moving away from “monolithic” application architecture to many individual services
8
DevOps Practices
• Continuous integration
• Continuous delivery & deployment
9
DevOps Practices
• Infrastructure as code
• Model your AWS resources using code
10
DevOps Practices
• Monitoring and logging
• Track and analyze metrics and logs
11
Benefits of DevOps
Speed
Security Scale
12
Comprehensive set of enterprise-grade tools
Comprehensive set of enterprise-grade tools
CI/CD Tools Infrastructure as Code IDE Monitoring & Tracing Web Apps
IDE and DevOps Toolkits CLI and Scripting Tools Languages Mobile
Visual Studio IntelliJ PyCharm Visual Studio Eclipse VSTS Amazon AWS
Code AWS CLI Tools for Corretto Amplify
PowerShell
SDKs
13
Cloud9
AWS Cloud9
16
Full Editor
17
Wide selection of Run Times
18
Full debug
19
Integrated Tools for Serverless Development
20
AWS CloudFormation
AWS CloudFormation
• Simplified way to create and manage a collection of AWS
resources
• Enables orderly and predictable provisioning and updating of
resources
• Enables version control of your AWS infrastructure
• Deploy and update stacks using the AWS Management Console,
the AWS Command Line Interface (CLI), or the AWS API
• Only pay for the resources you create
22
Overview
A running
environment
Template
AWS Stack
CloudFormation
23
Infrastructure
Infrastructure as as code
code
Template
• Single source of truth to deploy the whole stack
• Infrastructure that you can replicate, re-deploy, and re-
purpose
• Control versioning on your infrastructure and your
Stack Stack Stack
application together
• Service rolls back to the last good state on failures
• Build your infrastructure and run it through your CI/CD
pipeline
24
Stack creation
• You use a template to create and manage
a stack
25
Create and manage a stack using the AWS CLI
Returns the details of the created stack, in the output format of your choice
Returns the details of the created stack, in the output format of your choice
arn:aws:cloudformation:us-east-1:496891363831:stack/t1/625f07c0-1fef-
11e8-a501-50d5ca63261e
26
Template anatomy
{
"AWSTemplateFormatVersion" : "version date",
"Description" : ”Just another JSON String”,
"Metadata" : {
JSON objects that provide additional information about the template.
},
"Parameters" : {
Specifies values that you can pass in to your template at runtime
(when you create or update a stack )
},
2. Transform (new) },
(when you create or update a stack)
3. Description "Conditions" : {
Defines conditions that control whether certain resources are created
4. Metadata or whether certain resource properties are assigned a value during stack creation
or update.
5. Parameters },
"Resources" : {
7. Conditions },
bucket.
9. Outputs }
}
Reference: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref.html
27
Template anatomy
28
Continuous integration &
Continuous deployment
AWS Code Services
Software Release Steps
30
AWS Code Services
Software Release Steps
AWS CodeCommit
31
AWS Code Services
Software Release Steps
AWS CodeBuild
32
AWS Code Services
Software Release Steps
33
AWS Code Services
Software Release Steps
AWS CodeDeploy
34
AWS Code Services
Software Release Steps:
AWS CodePipeline
35
AWS CodeCommit
36
Control source code on the cloud
37
AWS CodeCommit
Git objects on
Amazon S3
Git index on
Amazon DynamoDB
SSH or HTTPS
38
Same Git Experience
$ git clone https://git-codecommit.us-east-1.amazonaws.com/v1/repos/aws-cli
Cloning into 'aws-cli'...
Receiving objects: 100% (16032/16032), 5.55 MiB | 1.25 MiB/s, done.
Resolving deltas: 100% (9900/9900), done.
Checking connectivity... done.
$ nano README.rst
$ git commit -am 'updated README'
[master 4fa0318] updated README
1 file changed, 1 insertion(+)
39
AWS CodeBuild
40
How it works?
1. Downloads the source code
2. Runs the defined commands from buildspec file using temporary containers ( new
containers are created for each build)
3. Send build logs to the console and Amazon CloudWatch logs
4. Send the built artifacts to a Amazon S3 bucket
41
File Example buildspec.yml
version: 0.1
environment_variables:
plaintext:
JAVA_HOME: "/usr/lib/jvm/java-8-openjdk-amd64"
phases:
install:
commands:
- apt-get update -y
- apt-get install -y maven
pre_build:
commands:
- echo Nothing to do in the pre_build phase...
build:
commands:
- echo Build started on `date`
- mvn install
post_build:
commands:
- echo Build completed on `date`
artifacts:
type: zip
files:
- target/messageUtil-1.0.jar
discard-paths: yes
43
Building your code
• Typically, the Build process refers to the source code developed
using programming languages that needs to be compiled:
• .NET: C#, F#, VB.net, etc.
• Go
EC2
44
And if you don't need to build…
• Several programming languages doesn’t need to be compiled.
They are considered interpreted languages:
• PHP
• Ruby
• Python
• Node.js
• You just need to deploy your source code
EC2
45
AWS CodeDeploy
• Automates code deployments in any instance
46
File Example appspec.yml
version: 0.0
os: linux
files:
Send application files to one
- source: /
directory and configuration files to
destination: /var/www/html
another
permissions:
- object: /var/www/html
pattern: “*.html” Set specific permissions on
owner: root directories and files.
group: root
mode: 755
hooks:
ApplicationStop:
- location: scripts/deregister_from_elb.sh
Remove / add instances to Elastic
BeforeInstall:
Load Balancing
- location: scripts/install_dependencies.sh
Install dependency packages
ApplicationStart:
Start Apache
- location: scripts/start_httpd.sh
Confirm deployment success
ValidateService:
- location: scripts/test_site.sh
- location: scripts/register_with_elb.sh
47
Choose speed and deployment group
Dev deployment group
One at a time
v2 v1 v1 v1 v1 v1 Agent Agent
OR
Half at a time Prod deployment group
v2 v2 v2 v1 v1 v1
Agent Agent Agent
All at once
v2 v2 v2 v2 v2 v2 Agent Agent Agent
48
AWS CodePipeline
49
AWS CodePipeline
MyApplication
Source
Source
GitHub
Build
Transition
Deploy
JavaApp
AWS Elastic
Beanstalk
AWS CodePipeline
MyApplication
Source
Source
GitHub
Build
Parallel actions
Deploy
JavaApp
Elastic Beanstalk
AWS CodePipeline
MyApplication
Source
Source
GitHub
Build
Deploy
JavaApp
Elastic Beanstalk
AWS CodePipeline
MyApplication
Build
AWS CodeBuild
AWS CodeBuild
Staging-Deploy
JavaApp
Elastic Beanstalk
QATeamReview
Manual Approval
Manual approvals
Review
Prod-Deploy
JavaApp
Elastic Beanstalk
AWS Elastic Beanstalk
AWS Elastic Beanstalk
The easiest way to get your web applications up and running in minutes
55
AWS Elastic Beanstalk Supports
56
How Elastic Beanstalk works
Your code
HTTP Server
Elastic Beanstalk
Application Server
• Bundled your source code together
with the corresponding platform (OS, Language Interpreter
runtime, application server, and web
server) Operating System
• Safely deployed your web application
Host
57
AWS services are plug and play
You can adopt a systematic approach to CI/CD tools and methodologies while leveraging
existing investments
1 2 3 4
AWS
GitHub Jenkins CodeBuild
repository Pipeline
58
Challenge: Extending to CI/CD
Or you can create robust but simple CI/CD across release stages (dev, staging, production)
with increasingly safer deployment status, deployment failure reporting, and ongoing health
monitoring using AWS services.
1 2 3 4
59
Questions?
Lab 2
• Go to https://aws.qwiklabs.com
• Login with your account.
• If you don’t have an account, register and then activate the account using the email that you
will receive.
• Start the Lab 2, and read the instructions.
• If you have doubts about the activity, please ask the trainer to receive help.
• You have 45 minutes to complete this lab.
61