SlideShare a Scribd company logo
AWS Context
Feb 12, 2017
Efficient way to manage
environments in AWS
2
• Shorter infrastructure cycles.
• Better predictability into failures.
• Time-saving for customer releases
• Reliable dynamic infrastructure
Efficiently Managing Environments :- Need
3
Managing Environments :- Key Components
Build
Deploy
Operate
Monitor
• Designing the right
rules and policies
• Configuring templates
to scale seamlessly.
• Integrate code-
deployment efficiently
with build
• Picking up right
configuration based on
environment
• Achieving faster boot-
times
• Blue- Green
Deployment for high
availability
• Promotion plan for
releases
• Rollback plan for any
failures
• Right set of Cloudwatch
monitoring.
• Different level of alarms
for failures.
• Auto-trigger post critical
Alarm actions
4
Use of Single Master Template
• Pass all the necessary inputs for all the
stacks only using a stack function.
• Each output resource can further be a
cloud-formation template creating the given
stack.
• Create common stacks such as alarms and
security which other stacks will re-use.
Build
5
Configure the same environment to scale differently Build
• Pass the Environment type as Input Parameter.
• Create the mapping for each environment type.
• Pass the mapping as reference while creating the AWS
resource.
• Example :-
• A RDS instance can now be m4.large in Performance environment but
m4.x.large in production without changing access rules and security
policies
6
Using User-data to automate code-deployments Build
Creating the right
configuration files
with AWS resource
e.g. instance file ,
metadata files etc.
Setting the right
role and
permissions to the
EC2 instance.
Copying the right
versioned
application and
deployment builds
from S3
Sourcing the
instance data file
Running the chef-
client on the given
role from instance
file
User data should be set as
a part of the cloud-
formation :-
http://answersforaws.com/
episodes/4-user-data-
cloud-init-cloudformation/
7
Stack Functions
• All of the above features in Cloud-formations can be automated
using stack functions :-
• create_environment
• delete_enviornment
• update_stack
• validate_enviornment.
• End to end environment create, update and delete at a single step.
• Building Cloud-Formation Dynamically
https://github.com/bazaarvoice/cloudformation-ruby-dsl
• Testing Cloud-Formation :- https://github.com/stelligent/cfn_nag
Build
8
• Custom AMI’s are built to reduce the Boot Time for
a EC2 instance to scale up.
• With the help of packer and automation the ability
to refresh environments can be scaled up.
• Polling job to figure out when the latest Base AMI
is available.
• Packer configuration to configure the right
repository for the Custom AMI.
• Packer script to bake the ami whenever the polling
job succeeds.
Customizing AMI’s Deploy
9
Break-down deployments into logical flows Deploy
All
the cookbooks
you are going
to use
All the recipes
you are going
to use
Roles and
their naming
convention
The number
of
environments
you are going
to use
Avoid the use of one giant cookbook
• We currently use 5 roles , each deriving
from a base role, each further divided
into cookbooks
10
Configuring Chef for Environments :- Guiding Patterns Deploy
• Vital to separate the deployment code for different
environments
• Light-weight deployment roles, independent of run-lists.
• Run-lists stored as part of default recipe of any cookbook.
• Env_Run_list to separate different run-list for different
environments.
• Use of Wrapper cookbooks to customize the settings of
upstream cookbooks without any forking.
11
Blue-Green Deployment uildOperate
Step 1:-
• Secondary ELB
stacked Down
12
Blue-Green Deployment :- Build Promote uildOperate
Step 2:-
• Secondary ELB
stacked up with
new build
13
Blue-Green Deployment :- Replace Stacks Operate
Step 3:-
• Stacks
Exchanged
between the
ELB’s
14
Build Release/Rollback :- Best Practices Operate
• Never promote/rollback between versions by changing DNS.
• Never register/deregister instances with/from the ELB
• Use of ELB health checks for service failures
• Use build-systems and S3 to keep a track to build version
numbers on each of the ELB’s
• Live File
• Pre-Live
• Live-Prev file
15
Alarm Stack :- Building the Right Trigger Monitor
• Alarms rules should be generic for all AWS resources in the environment.
• Each resource should have a unique alarm to help identify the exact failure.
• Warns the user before the actual failure, so the corrective action is taken.
• At the time nearing a failure, should trigger auto-healing steps to avoid an failure.
16
• Cloudwatch is used to monitor AWS resources like EC2,
on unusual usage pattern like High CPU, less memory
the alarms are triggered.
• Alarm stack is created by a Cloud Formation template
consisting of SNS Notifications . These SNS notification
further are hooked to third party apps like email, Pager-
duty etc.
• Alarm Stacks consists of level of Alarms depending on
severity of Cloudwatch Metrics failure
• Warning Alarm :- Just notify on email,
• Critical Alarm :- Pager-duty Call + Auto-scaling
event
• Alarms + Lambda :- https://medium.com/cohealo-
engineering/how-set-up-a-slack-channel-to-be-an-
aws-sns-subscriber-63b4d57ad3ea#.kcqs9cl8x
Alarm Stack :- Defining level of alarms
Database Stack with Alarms
Monitor
17
• Based on Metrics such as CPU-Utilization, ELB requests configure scaling
policies.
• Time to scale-up an instance should be considered .
• Using Scheduled Actions to change scaling policies of ASG’s for time-based
change in traffic
• Scale up early, scale down slowly.
Alarm Stack :- Scaling Based on Metrics Monitor

More Related Content

PPT
Leveraging Amazon's Elastic Block Store
PPTX
AWS - Autoscaling Fundamentals
PPTX
Architecting in Cloud : Your Guide to Amazon Web Services
PDF
Amazon Elastic Beanstalk
PPTX
AWS ECS workshop
PPTX
Continuous Delivery with Elastic Beanstalk And CodePipeline on AWS
PDF
AppScale + Neptune @ HPCDB
PDF
[Jun AWS 201] Elastic Beanstalk for Startups
Leveraging Amazon's Elastic Block Store
AWS - Autoscaling Fundamentals
Architecting in Cloud : Your Guide to Amazon Web Services
Amazon Elastic Beanstalk
AWS ECS workshop
Continuous Delivery with Elastic Beanstalk And CodePipeline on AWS
AppScale + Neptune @ HPCDB
[Jun AWS 201] Elastic Beanstalk for Startups

What's hot (18)

PDF
Active Cloud DB at CloudComp '10
PPTX
MongoDB in the Clouds
PDF
DPC 2016 - 53 Minutes or Less - Architecting For Failure
PDF
Auto Scaling Guided by Code
PDF
AppScale @ LA.rb
PPS
Empowering Amazon EC2 with GigaSpaces XAP
PDF
Neptune @ SoCal
PDF
Mesos meetup @ add this
PDF
Mesos meetup @ add this
PPTX
Understand AWS OpsWorks - A DevOps Tool from AWS
PDF
Terraform Architech
PPTX
Aws atlanta march_2015
PDF
Cloudformation vs terraform_vs_ansible
PPTX
Infrastructure Automation on AWS using a Real-World Customer Example
PPTX
Training And Serving ML Model Using Kubeflow by Jayesh Sharma
PPTX
Ansible
PPTX
5 Quick Wins for the Cloud
PDF
AWS Lambda at JUST EAT
Active Cloud DB at CloudComp '10
MongoDB in the Clouds
DPC 2016 - 53 Minutes or Less - Architecting For Failure
Auto Scaling Guided by Code
AppScale @ LA.rb
Empowering Amazon EC2 with GigaSpaces XAP
Neptune @ SoCal
Mesos meetup @ add this
Mesos meetup @ add this
Understand AWS OpsWorks - A DevOps Tool from AWS
Terraform Architech
Aws atlanta march_2015
Cloudformation vs terraform_vs_ansible
Infrastructure Automation on AWS using a Real-World Customer Example
Training And Serving ML Model Using Kubeflow by Jayesh Sharma
Ansible
5 Quick Wins for the Cloud
AWS Lambda at JUST EAT
Ad

Viewers also liked (15)

PPTX
Ponència visita alcalde
PDF
Genset/ Generator Set 1400KVA
PPTX
Neoclasico renni parica
PDF
Surgical & Non-surgical Treatment
PDF
Paid social media jobs
PPTX
Psychological Outcomes in Cosmetic Surgery
PPTX
Glosario melissa
PPTX
Clock divide by 3
PPTX
Alumnes marta hermo ppt
PDF
Facebook Statistics
PPTX
PDF
Actividad para trabajar fonemas
PDF
PDF
Annual Report
PDF
Come ottenere una consulenza utile per far crescere davvero la tua azienda
Ponència visita alcalde
Genset/ Generator Set 1400KVA
Neoclasico renni parica
Surgical & Non-surgical Treatment
Paid social media jobs
Psychological Outcomes in Cosmetic Surgery
Glosario melissa
Clock divide by 3
Alumnes marta hermo ppt
Facebook Statistics
Actividad para trabajar fonemas
Annual Report
Come ottenere una consulenza utile per far crescere davvero la tua azienda
Ad

Similar to Efficient way to manage environments in AWS (20)

PDF
AWS System Administration Best Practices for Sysadmins in the Amazon Cloud 1s...
PDF
AWS System Administration Best Practices for Sysadmins in the Amazon Cloud 1s...
PDF
Real world cloud formation feb 2014 final
PPTX
Managing AWS infrastructure using CloudFormation
PDF
AWS CloudFormation (February 2016)
PPTX
Introduction to DevOps on AWS
PDF
Scaling on AWS
PDF
Scaling on AWS
PDF
AWS DevOps - Terraform, Docker, HashiCorp Vault
PPTX
Modernizing your AWS Deployment
PDF
AWS in Practice
PDF
20141021 AWS Cloud Taekwon - Startup Best Practices on AWS
PPTX
Patterns for building resilient and scalable microservices platform on AWS
PDF
Forge - DevCon 2016: Developing & Deploying Secure, Scalable Applications on ...
PPTX
CLOUD_COMPUTING_AWS_TRAINING.pptx
PDF
AWS Certified Solutions Architect Associate Exam Guide 1st Edition 2024_KIRAN...
PPTX
Scaling horizontally on AWS
PPTX
AWS Monitoring & Logging
PPTX
Introduction to amazon web services for developers
PPTX
Weaveworks at AWS re:Invent 2016: Operations Management with Amazon ECS
AWS System Administration Best Practices for Sysadmins in the Amazon Cloud 1s...
AWS System Administration Best Practices for Sysadmins in the Amazon Cloud 1s...
Real world cloud formation feb 2014 final
Managing AWS infrastructure using CloudFormation
AWS CloudFormation (February 2016)
Introduction to DevOps on AWS
Scaling on AWS
Scaling on AWS
AWS DevOps - Terraform, Docker, HashiCorp Vault
Modernizing your AWS Deployment
AWS in Practice
20141021 AWS Cloud Taekwon - Startup Best Practices on AWS
Patterns for building resilient and scalable microservices platform on AWS
Forge - DevCon 2016: Developing & Deploying Secure, Scalable Applications on ...
CLOUD_COMPUTING_AWS_TRAINING.pptx
AWS Certified Solutions Architect Associate Exam Guide 1st Edition 2024_KIRAN...
Scaling horizontally on AWS
AWS Monitoring & Logging
Introduction to amazon web services for developers
Weaveworks at AWS re:Invent 2016: Operations Management with Amazon ECS

Recently uploaded (20)

PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
L1 - Introduction to python Backend.pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
ISO 45001 Occupational Health and Safety Management System
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
Introduction to Artificial Intelligence
PDF
AI in Product Development-omnex systems
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Transform Your Business with a Software ERP System
Odoo Companies in India – Driving Business Transformation.pdf
CHAPTER 2 - PM Management and IT Context
How Creative Agencies Leverage Project Management Software.pdf
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
L1 - Introduction to python Backend.pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Understanding Forklifts - TECH EHS Solution
ISO 45001 Occupational Health and Safety Management System
PTS Company Brochure 2025 (1).pdf.......
Introduction to Artificial Intelligence
AI in Product Development-omnex systems
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Softaken Excel to vCard Converter Software.pdf
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
How to Migrate SBCGlobal Email to Yahoo Easily
Design an Analysis of Algorithms II-SECS-1021-03
Which alternative to Crystal Reports is best for small or large businesses.pdf
VVF-Customer-Presentation2025-Ver1.9.pptx
Transform Your Business with a Software ERP System

Efficient way to manage environments in AWS

  • 1. AWS Context Feb 12, 2017 Efficient way to manage environments in AWS
  • 2. 2 • Shorter infrastructure cycles. • Better predictability into failures. • Time-saving for customer releases • Reliable dynamic infrastructure Efficiently Managing Environments :- Need
  • 3. 3 Managing Environments :- Key Components Build Deploy Operate Monitor • Designing the right rules and policies • Configuring templates to scale seamlessly. • Integrate code- deployment efficiently with build • Picking up right configuration based on environment • Achieving faster boot- times • Blue- Green Deployment for high availability • Promotion plan for releases • Rollback plan for any failures • Right set of Cloudwatch monitoring. • Different level of alarms for failures. • Auto-trigger post critical Alarm actions
  • 4. 4 Use of Single Master Template • Pass all the necessary inputs for all the stacks only using a stack function. • Each output resource can further be a cloud-formation template creating the given stack. • Create common stacks such as alarms and security which other stacks will re-use. Build
  • 5. 5 Configure the same environment to scale differently Build • Pass the Environment type as Input Parameter. • Create the mapping for each environment type. • Pass the mapping as reference while creating the AWS resource. • Example :- • A RDS instance can now be m4.large in Performance environment but m4.x.large in production without changing access rules and security policies
  • 6. 6 Using User-data to automate code-deployments Build Creating the right configuration files with AWS resource e.g. instance file , metadata files etc. Setting the right role and permissions to the EC2 instance. Copying the right versioned application and deployment builds from S3 Sourcing the instance data file Running the chef- client on the given role from instance file User data should be set as a part of the cloud- formation :- http://answersforaws.com/ episodes/4-user-data- cloud-init-cloudformation/
  • 7. 7 Stack Functions • All of the above features in Cloud-formations can be automated using stack functions :- • create_environment • delete_enviornment • update_stack • validate_enviornment. • End to end environment create, update and delete at a single step. • Building Cloud-Formation Dynamically https://github.com/bazaarvoice/cloudformation-ruby-dsl • Testing Cloud-Formation :- https://github.com/stelligent/cfn_nag Build
  • 8. 8 • Custom AMI’s are built to reduce the Boot Time for a EC2 instance to scale up. • With the help of packer and automation the ability to refresh environments can be scaled up. • Polling job to figure out when the latest Base AMI is available. • Packer configuration to configure the right repository for the Custom AMI. • Packer script to bake the ami whenever the polling job succeeds. Customizing AMI’s Deploy
  • 9. 9 Break-down deployments into logical flows Deploy All the cookbooks you are going to use All the recipes you are going to use Roles and their naming convention The number of environments you are going to use Avoid the use of one giant cookbook • We currently use 5 roles , each deriving from a base role, each further divided into cookbooks
  • 10. 10 Configuring Chef for Environments :- Guiding Patterns Deploy • Vital to separate the deployment code for different environments • Light-weight deployment roles, independent of run-lists. • Run-lists stored as part of default recipe of any cookbook. • Env_Run_list to separate different run-list for different environments. • Use of Wrapper cookbooks to customize the settings of upstream cookbooks without any forking.
  • 11. 11 Blue-Green Deployment uildOperate Step 1:- • Secondary ELB stacked Down
  • 12. 12 Blue-Green Deployment :- Build Promote uildOperate Step 2:- • Secondary ELB stacked up with new build
  • 13. 13 Blue-Green Deployment :- Replace Stacks Operate Step 3:- • Stacks Exchanged between the ELB’s
  • 14. 14 Build Release/Rollback :- Best Practices Operate • Never promote/rollback between versions by changing DNS. • Never register/deregister instances with/from the ELB • Use of ELB health checks for service failures • Use build-systems and S3 to keep a track to build version numbers on each of the ELB’s • Live File • Pre-Live • Live-Prev file
  • 15. 15 Alarm Stack :- Building the Right Trigger Monitor • Alarms rules should be generic for all AWS resources in the environment. • Each resource should have a unique alarm to help identify the exact failure. • Warns the user before the actual failure, so the corrective action is taken. • At the time nearing a failure, should trigger auto-healing steps to avoid an failure.
  • 16. 16 • Cloudwatch is used to monitor AWS resources like EC2, on unusual usage pattern like High CPU, less memory the alarms are triggered. • Alarm stack is created by a Cloud Formation template consisting of SNS Notifications . These SNS notification further are hooked to third party apps like email, Pager- duty etc. • Alarm Stacks consists of level of Alarms depending on severity of Cloudwatch Metrics failure • Warning Alarm :- Just notify on email, • Critical Alarm :- Pager-duty Call + Auto-scaling event • Alarms + Lambda :- https://medium.com/cohealo- engineering/how-set-up-a-slack-channel-to-be-an- aws-sns-subscriber-63b4d57ad3ea#.kcqs9cl8x Alarm Stack :- Defining level of alarms Database Stack with Alarms Monitor
  • 17. 17 • Based on Metrics such as CPU-Utilization, ELB requests configure scaling policies. • Time to scale-up an instance should be considered . • Using Scheduled Actions to change scaling policies of ASG’s for time-based change in traffic • Scale up early, scale down slowly. Alarm Stack :- Scaling Based on Metrics Monitor