SlideShare a Scribd company logo
Vagrant to AWS Flow
Delivered by Colin Johnson, BlueChipTek (@bluechiptek)
Who am I?
• DevOps Engineer and Occasional Developer
• Certifications:
• AWS Certified Solutions Architect – Associate Level (Number 224)
• AWS Certified SysOps Administrator – Associate Level (Number 2564)
• Worked with a number of Bay Area companies: inPowered, Jive Software, Lyft,
NetShelter, Wingz
• Contributed VPC and Testing Support for boto_* Modules in SaltStack Project
Goals for this Presentation
• Understand benefits and pain points of cloud, local and vagrant based
development
• Describe a development flow that combines vagrant and AWS to
create a:
• consistent environments for all developers
• consistent environment from development to production
• help organizations move fast – if they are not already doing this
• integrate nearly flawlessly with AWS
• Ease Development <-> Production Software Deployment
Why Vagrant to AWS Flow?
• Benefits for Everyone:
• Really Fast. Minutes to get a development environment setup.
• Really Fast. No lag to test code changes.
• Really Consistent. More similar to production than traditional “local” development.
• Easy. Developers just type “vagrant ssh”
• Developers
• Develop Offline
• Provision Infrastructure on Own
• DevOps / Operations
• No need to be involved in development or environment setup.
• QA
• Test Offline.
• Automate Testing.
What does Vagrant do?
• Simple Use Case:
• Allows local development.
• Offline? No Problem.
• Ensures consistency.
• You use a Mac, your co-worker uses Windows but you want to run your app on Ubuntu?
No Problem.
• Advanced Use Cases:
• Allows local development of an entire “dev” or “qa” application.
• Your application depends on MySQL, redis and an application developed by another
group as well? No problem. Run them all locally.
• Run tests.
• Need to run tests quickly but don’t want to automate infrastructure? No problem.
Vagrant up. Test. Vagrant destroy.
Experts at inPowered
• Problem - developers loved AWS, but wanted to develop locally.
• Developers couldn’t develop offline
• Developers had to “share” a single Development environment
• Developers were developing on OS X whereas production was Amazon Linux
• Developers were struggling to access Redis/MySQL and other dependencies
• Solution:
• Vagrant + AWS Flow:
• Develop in Vagrant, Ship to AWS!
• Ubuntu 15.04 for both Vagrant and AWS
• Same configuration management for both Vagrant and AWS
• Vagrant:
• offline development
• per developer environments
• all dependencies were run or “mocked” locally
Salt boto_* Module Development at Lyft
• Project:
• adding VPC support and testing to salt’s boto_* modules
(https://github.com/saltstack/salt/)
• Problems:
• Needed to do testing of AWS automation (approximately 200+ tests), but building
test environment load balancers, security groups, etc was taking too long as did calls
• Preferred testing locally
• Preferred testing with multiple Operating Systems
• Solution:
• Two Vagrant instances for Running Salt – Ubuntu 12.04 and 14.04 – fresh
environment for every test
• Moto* for mocking AWS calls (https://github.com/spulec/moto)
• Tests could be run by simply typing “vagrant up” and results could be generated and
reviewed
Vagrant Development vs Cloud Development
• One Environment for each Developer on Cloud Platform
• Administration burden – DevOps either has to Build or Automate
• I used to spend 10 hours/week setting up environments for new Developers
• Inefficient Spend
• Connectivity and Security requirements extends to uncontrolled
“Development” environments
• Shared Development on Cloud Platform
• Sharing? You must be kidding.
• Who “owns” the server? Your feature, my configuration change and someone else’s
change are all mixed together. Testing is going to be so fun!
• AWS / Cloud Development does typically offer all dependencies and
services.
Vagrant Development vs Cloud Development:
Act I – Internet Access Required
• Developer 1:
• Going to be on vacation for the next week. Probably limited Internet access.
• Manager:
• No problem. Can you get the new “every metric for every user action feature”
shipped on Monday?
• Developer 1:
• I’ll try, but I can’t really test my code in without Internet.
Vagrant Development vs Cloud Development:
Act II – Access and Management Headaches
• DevOps Engineer:
• It looks like port 22 and port 80 in all our development environments are open.
Google just crawled all our development sites.
• Manager:
• Do you know why all the ports are open?
• DevOps Engineer:
• The docs for the webserver project say “to ssh in or do web testing, go to the
security group and open ports 22 and 80 to 0.0.0.0/0”
• Manager:
• Do you know why?
• DevOps Engineer:
• I think the Developers get tired of waiting for VPN credentials to be issued.
Vagrant Development vs Local Development
• Match local and production environments
• Local environment (OS X, Windows or *nix) may not match production
• Faster Environment Standup
• Run same configuration management as production!
• Develop Offline / Complete infrastructure available
• Run your app and all dependencies
Vagrant Dev vs Local Dev:
Act I – Dev/Prod Inconsistency
• Developer:
• It worked on my machine.
• DevOps:
• So, it worked on OS X 10.9.2, nginx preview release 1.9.11 and MariaDB.
• Developer:
• Yes. I also had to install SciPy and NumPy.
• DevOps:
• Anything else?
• Developer:
• I think that is it. Make sure to use SciPy 0.17.
Vagrant Development vs Local Development
Act II – Local Development Inconsistency
• Developer 1:
• It worked on my machine. OS X 10.9.2 with nginx 1.9.11 preview release…
• Developer 2:
• I’m running Windows. 10.
• Developer 1:
• Damn. Get a Mac. Everyone else uses them.
• Developer 3:
• You should use Linux. Same as production. Except for MariaDB instead of
MySQL. But I don’t think that’s a problem.
Vagrant Development vs Local Development
Act III – Running the Application
• Developer 1:
• I’ve been trying to get nginx 1.9.11 preview installed on my Mac for the last
four hours
• Developer 2:
• Use homebrew. I found an article online somewhere.
• Developer 2:
• Here’s a link: http://www.robertmulley.com/tutorial/nginx-install-and-setup-
mac-os-x-yosemite/
• Developer 1:
• Link me for MongoDB, InfluxDB and Redis installs as well :-)
Vagrant to AWS Flow:
• Standup Development in Minutes
• Easy ssh Access
• Easy file access
• Run local mocks
• No sharing environments!
Vagrant + AWS: How To
• Use same OS in Vagrant as AWS
• Separate and Make Modular Each “Concern”
• Infrastructure Provisioning
• Configuration Management
• Software Deployment
• Avoid or Be Aware of Platform Specific Technologies
• Vagrant synced_folder = not available in AWS – you can still use for software
deployment
• AWS IAM Profile = not available in Vagrant/Virtualbox – you can still use for
software deployment
Vagrant Setup
• Infrastructure Provisioning:
• Run “vagrant up”
• Uses a Vagrantfile in root directory of project
• Vagrantfile defines:
• CPU, Memory
• Operating System – use same as AWS!
• A “Provisioner” – which runs Configuration Management
• Configuration Management (aka “Provisioner”)
• I prefer shell as “glue code”
• Use same Configuration Management as AWS - Ansible, Chef, Puppet, Salt, etc.
• Software Deployment
• In Vagrant, use a “synced directory”– then changes made by developers are manifest
in real-time near real-time
AWS Setup
• Infrastructure Provisioning:
• Run “cfn-create-stack”
• Creates an Auto Scaling Group and Launch Configuration with user-data
• Use same OS as Vagrant!
• Launch Configuration calls Configuration Management
• Configuration Management (aka “Provisioner”)
• I prefer shell as “glue code”
• Use same Configuration Management as Vagrant - Ansible, Chef, Puppet, Salt,
etc.
• Software Deployment
• Use whatever you’d like…
Vagrant to AWS Flow - Diagram
Whatever you’d like…
- Ansible
- Chef
- Other
- Puppet
- SaltStack
- Shell Script(s)?
Just run same thing on
both AWS and Vagrant!
Vagrant
AWS /
CloudFormation
Creates
Instance(s)
Software
Deployment
Infrastructure
Provisioning
Configuration
Management
Vagrant
- “sync_dir”
AWS
Whatever you’d like:
- AWS Code Deploy
- Fabric
- Git Push
- Artifact and Sync
Demo
In the next 15 minutes we will:
1. Standup local development infrastructure on Ubuntu.
1. And look at a Vagrantfile.
2. Standup identical* production infrastructure in AWS.
1. And look at a CloudFormation file.
3. Deploy code to AWS and run the same code in Dev/Prod.
1. The deployment tool is a bit of a hack, btw…

More Related Content

ODP
It Works On My Machine: Vagrant for Software Development
PDF
Multi-provider Vagrant and Chef: AWS, VMware, and more
PDF
Vagrant for real (codemotion rome 2016)
PPTX
Vagrant crash course
PPTX
How To Set a Vagrant Development System
PDF
Ansible - A 'crowd' introduction
PDF
Deploying PHP Applications with Ansible
PDF
Using Docker with Puppet - PuppetConf 2014
It Works On My Machine: Vagrant for Software Development
Multi-provider Vagrant and Chef: AWS, VMware, and more
Vagrant for real (codemotion rome 2016)
Vagrant crash course
How To Set a Vagrant Development System
Ansible - A 'crowd' introduction
Deploying PHP Applications with Ansible
Using Docker with Puppet - PuppetConf 2014

What's hot (20)

PDF
Vagrant For DevOps
PDF
Drone your Ansible
KEY
PPTX
Vagrant introduction for Developers
PDF
Automated Deployment with Capistrano
PPTX
Package Management on Windows with Chocolatey
PDF
Steamlining your puppet development workflow
PPTX
Baking docker using chef
PDF
Docker and Puppet for Continuous Integration
PDF
GlassFish Embedded API
PDF
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
PDF
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
PDF
Dependencies and Licenses
PDF
Vagrant presentation
PDF
Vagrant for Virtualized Development
PDF
Automated Infrastructure and Application Management
PDF
Deploying Symfony | symfony.cat
PPTX
Installaling Puppet Master and Agent
PDF
CI/CD Using Ansible and Jenkins for Infrastructure
PDF
Continuous delivery with jenkins, docker and exoscale
Vagrant For DevOps
Drone your Ansible
Vagrant introduction for Developers
Automated Deployment with Capistrano
Package Management on Windows with Chocolatey
Steamlining your puppet development workflow
Baking docker using chef
Docker and Puppet for Continuous Integration
GlassFish Embedded API
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
Dependencies and Licenses
Vagrant presentation
Vagrant for Virtualized Development
Automated Infrastructure and Application Management
Deploying Symfony | symfony.cat
Installaling Puppet Master and Agent
CI/CD Using Ansible and Jenkins for Infrastructure
Continuous delivery with jenkins, docker and exoscale
Ad

Similar to Vagrant to-aws-flow (20)

PDF
Vagrant for Effective DevOps Culture
PDF
Powering Development and Testing Environments with Vagrant
PDF
Rise of the machines: Continuous Delivery at SEEK - YOW! Night Summary Slides
PDF
Virtualization with Vagrant (ua.pycon 2011)
ODP
Vagrant and puppet: Deployment made easy
PDF
Vagrant
PDF
Instant LAMP Stack with Vagrant and Puppet
PDF
Keep calm and vagrant up
PDF
Take Home Your Very Own Free Vagrant CFML Dev Environment
PDF
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
PDF
Vagrant - Version control your dev environment
PPT
Linux containers and docker
PDF
Containing the world with Docker
PDF
DevOps introduction with ansible, vagrant, and docker
PDF
DevOps introduction with ansible, vagrant, and docker
PPTX
Vagrant
PPTX
DevOps, A brief introduction to Vagrant & Ansible
PDF
Improved development workflows using vagrant
PPTX
Development with Vagrant
PDF
Vagrant for local and team WordPress Development
Vagrant for Effective DevOps Culture
Powering Development and Testing Environments with Vagrant
Rise of the machines: Continuous Delivery at SEEK - YOW! Night Summary Slides
Virtualization with Vagrant (ua.pycon 2011)
Vagrant and puppet: Deployment made easy
Vagrant
Instant LAMP Stack with Vagrant and Puppet
Keep calm and vagrant up
Take Home Your Very Own Free Vagrant CFML Dev Environment
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Vagrant - Version control your dev environment
Linux containers and docker
Containing the world with Docker
DevOps introduction with ansible, vagrant, and docker
DevOps introduction with ansible, vagrant, and docker
Vagrant
DevOps, A brief introduction to Vagrant & Ansible
Improved development workflows using vagrant
Development with Vagrant
Vagrant for local and team WordPress Development
Ad

More from Kimberly Macias (8)

PDF
Blue Chip Tek/ Rook Security - Cloud Security Connect and Protect
DOCX
AWS VPN with Juniper SRX- Lab Sheet
PPTX
Bct Aws-VPC-Training
PPTX
Blue Chip Tek Connect and Protect Presentation #1
PPTX
Blue Chip Tek Connect and Protect Presentation #3
PPTX
Blue Chip Tek AWS Connect and Protect Presentation #2
PPTX
Contrail Basics
PPTX
Aws Autoscaling
Blue Chip Tek/ Rook Security - Cloud Security Connect and Protect
AWS VPN with Juniper SRX- Lab Sheet
Bct Aws-VPC-Training
Blue Chip Tek Connect and Protect Presentation #1
Blue Chip Tek Connect and Protect Presentation #3
Blue Chip Tek AWS Connect and Protect Presentation #2
Contrail Basics
Aws Autoscaling

Recently uploaded (20)

PDF
TRAFFIC-MANAGEMENT-AND-ACCIDENT-INVESTIGATION-WITH-DRIVING-PDF-FILE.pdf
PPTX
Database Infoormation System (DBIS).pptx
PDF
Launch Your Data Science Career in Kochi – 2025
PPTX
Major-Components-ofNKJNNKNKNKNKronment.pptx
PPTX
Supervised vs unsupervised machine learning algorithms
PPTX
05. PRACTICAL GUIDE TO MICROSOFT EXCEL.pptx
PPTX
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
PPTX
Acceptance and paychological effects of mandatory extra coach I classes.pptx
PPTX
Global journeys: estimating international migration
PPTX
Introduction to Knowledge Engineering Part 1
PDF
Mega Projects Data Mega Projects Data
PPT
Miokarditis (Inflamasi pada Otot Jantung)
PPT
Chapter 2 METAL FORMINGhhhhhhhjjjjmmmmmmmmm
PPTX
Moving the Public Sector (Government) to a Digital Adoption
PDF
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
PPTX
Data_Analytics_and_PowerBI_Presentation.pptx
PDF
Foundation of Data Science unit number two notes
PDF
“Getting Started with Data Analytics Using R – Concepts, Tools & Case Studies”
PPTX
Introduction-to-Cloud-ComputingFinal.pptx
PDF
Clinical guidelines as a resource for EBP(1).pdf
TRAFFIC-MANAGEMENT-AND-ACCIDENT-INVESTIGATION-WITH-DRIVING-PDF-FILE.pdf
Database Infoormation System (DBIS).pptx
Launch Your Data Science Career in Kochi – 2025
Major-Components-ofNKJNNKNKNKNKronment.pptx
Supervised vs unsupervised machine learning algorithms
05. PRACTICAL GUIDE TO MICROSOFT EXCEL.pptx
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
Acceptance and paychological effects of mandatory extra coach I classes.pptx
Global journeys: estimating international migration
Introduction to Knowledge Engineering Part 1
Mega Projects Data Mega Projects Data
Miokarditis (Inflamasi pada Otot Jantung)
Chapter 2 METAL FORMINGhhhhhhhjjjjmmmmmmmmm
Moving the Public Sector (Government) to a Digital Adoption
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
Data_Analytics_and_PowerBI_Presentation.pptx
Foundation of Data Science unit number two notes
“Getting Started with Data Analytics Using R – Concepts, Tools & Case Studies”
Introduction-to-Cloud-ComputingFinal.pptx
Clinical guidelines as a resource for EBP(1).pdf

Vagrant to-aws-flow

  • 1. Vagrant to AWS Flow Delivered by Colin Johnson, BlueChipTek (@bluechiptek)
  • 2. Who am I? • DevOps Engineer and Occasional Developer • Certifications: • AWS Certified Solutions Architect – Associate Level (Number 224) • AWS Certified SysOps Administrator – Associate Level (Number 2564) • Worked with a number of Bay Area companies: inPowered, Jive Software, Lyft, NetShelter, Wingz • Contributed VPC and Testing Support for boto_* Modules in SaltStack Project
  • 3. Goals for this Presentation • Understand benefits and pain points of cloud, local and vagrant based development • Describe a development flow that combines vagrant and AWS to create a: • consistent environments for all developers • consistent environment from development to production • help organizations move fast – if they are not already doing this • integrate nearly flawlessly with AWS • Ease Development <-> Production Software Deployment
  • 4. Why Vagrant to AWS Flow? • Benefits for Everyone: • Really Fast. Minutes to get a development environment setup. • Really Fast. No lag to test code changes. • Really Consistent. More similar to production than traditional “local” development. • Easy. Developers just type “vagrant ssh” • Developers • Develop Offline • Provision Infrastructure on Own • DevOps / Operations • No need to be involved in development or environment setup. • QA • Test Offline. • Automate Testing.
  • 5. What does Vagrant do? • Simple Use Case: • Allows local development. • Offline? No Problem. • Ensures consistency. • You use a Mac, your co-worker uses Windows but you want to run your app on Ubuntu? No Problem. • Advanced Use Cases: • Allows local development of an entire “dev” or “qa” application. • Your application depends on MySQL, redis and an application developed by another group as well? No problem. Run them all locally. • Run tests. • Need to run tests quickly but don’t want to automate infrastructure? No problem. Vagrant up. Test. Vagrant destroy.
  • 6. Experts at inPowered • Problem - developers loved AWS, but wanted to develop locally. • Developers couldn’t develop offline • Developers had to “share” a single Development environment • Developers were developing on OS X whereas production was Amazon Linux • Developers were struggling to access Redis/MySQL and other dependencies • Solution: • Vagrant + AWS Flow: • Develop in Vagrant, Ship to AWS! • Ubuntu 15.04 for both Vagrant and AWS • Same configuration management for both Vagrant and AWS • Vagrant: • offline development • per developer environments • all dependencies were run or “mocked” locally
  • 7. Salt boto_* Module Development at Lyft • Project: • adding VPC support and testing to salt’s boto_* modules (https://github.com/saltstack/salt/) • Problems: • Needed to do testing of AWS automation (approximately 200+ tests), but building test environment load balancers, security groups, etc was taking too long as did calls • Preferred testing locally • Preferred testing with multiple Operating Systems • Solution: • Two Vagrant instances for Running Salt – Ubuntu 12.04 and 14.04 – fresh environment for every test • Moto* for mocking AWS calls (https://github.com/spulec/moto) • Tests could be run by simply typing “vagrant up” and results could be generated and reviewed
  • 8. Vagrant Development vs Cloud Development • One Environment for each Developer on Cloud Platform • Administration burden – DevOps either has to Build or Automate • I used to spend 10 hours/week setting up environments for new Developers • Inefficient Spend • Connectivity and Security requirements extends to uncontrolled “Development” environments • Shared Development on Cloud Platform • Sharing? You must be kidding. • Who “owns” the server? Your feature, my configuration change and someone else’s change are all mixed together. Testing is going to be so fun! • AWS / Cloud Development does typically offer all dependencies and services.
  • 9. Vagrant Development vs Cloud Development: Act I – Internet Access Required • Developer 1: • Going to be on vacation for the next week. Probably limited Internet access. • Manager: • No problem. Can you get the new “every metric for every user action feature” shipped on Monday? • Developer 1: • I’ll try, but I can’t really test my code in without Internet.
  • 10. Vagrant Development vs Cloud Development: Act II – Access and Management Headaches • DevOps Engineer: • It looks like port 22 and port 80 in all our development environments are open. Google just crawled all our development sites. • Manager: • Do you know why all the ports are open? • DevOps Engineer: • The docs for the webserver project say “to ssh in or do web testing, go to the security group and open ports 22 and 80 to 0.0.0.0/0” • Manager: • Do you know why? • DevOps Engineer: • I think the Developers get tired of waiting for VPN credentials to be issued.
  • 11. Vagrant Development vs Local Development • Match local and production environments • Local environment (OS X, Windows or *nix) may not match production • Faster Environment Standup • Run same configuration management as production! • Develop Offline / Complete infrastructure available • Run your app and all dependencies
  • 12. Vagrant Dev vs Local Dev: Act I – Dev/Prod Inconsistency • Developer: • It worked on my machine. • DevOps: • So, it worked on OS X 10.9.2, nginx preview release 1.9.11 and MariaDB. • Developer: • Yes. I also had to install SciPy and NumPy. • DevOps: • Anything else? • Developer: • I think that is it. Make sure to use SciPy 0.17.
  • 13. Vagrant Development vs Local Development Act II – Local Development Inconsistency • Developer 1: • It worked on my machine. OS X 10.9.2 with nginx 1.9.11 preview release… • Developer 2: • I’m running Windows. 10. • Developer 1: • Damn. Get a Mac. Everyone else uses them. • Developer 3: • You should use Linux. Same as production. Except for MariaDB instead of MySQL. But I don’t think that’s a problem.
  • 14. Vagrant Development vs Local Development Act III – Running the Application • Developer 1: • I’ve been trying to get nginx 1.9.11 preview installed on my Mac for the last four hours • Developer 2: • Use homebrew. I found an article online somewhere. • Developer 2: • Here’s a link: http://www.robertmulley.com/tutorial/nginx-install-and-setup- mac-os-x-yosemite/ • Developer 1: • Link me for MongoDB, InfluxDB and Redis installs as well :-)
  • 15. Vagrant to AWS Flow: • Standup Development in Minutes • Easy ssh Access • Easy file access • Run local mocks • No sharing environments!
  • 16. Vagrant + AWS: How To • Use same OS in Vagrant as AWS • Separate and Make Modular Each “Concern” • Infrastructure Provisioning • Configuration Management • Software Deployment • Avoid or Be Aware of Platform Specific Technologies • Vagrant synced_folder = not available in AWS – you can still use for software deployment • AWS IAM Profile = not available in Vagrant/Virtualbox – you can still use for software deployment
  • 17. Vagrant Setup • Infrastructure Provisioning: • Run “vagrant up” • Uses a Vagrantfile in root directory of project • Vagrantfile defines: • CPU, Memory • Operating System – use same as AWS! • A “Provisioner” – which runs Configuration Management • Configuration Management (aka “Provisioner”) • I prefer shell as “glue code” • Use same Configuration Management as AWS - Ansible, Chef, Puppet, Salt, etc. • Software Deployment • In Vagrant, use a “synced directory”– then changes made by developers are manifest in real-time near real-time
  • 18. AWS Setup • Infrastructure Provisioning: • Run “cfn-create-stack” • Creates an Auto Scaling Group and Launch Configuration with user-data • Use same OS as Vagrant! • Launch Configuration calls Configuration Management • Configuration Management (aka “Provisioner”) • I prefer shell as “glue code” • Use same Configuration Management as Vagrant - Ansible, Chef, Puppet, Salt, etc. • Software Deployment • Use whatever you’d like…
  • 19. Vagrant to AWS Flow - Diagram Whatever you’d like… - Ansible - Chef - Other - Puppet - SaltStack - Shell Script(s)? Just run same thing on both AWS and Vagrant! Vagrant AWS / CloudFormation Creates Instance(s) Software Deployment Infrastructure Provisioning Configuration Management Vagrant - “sync_dir” AWS Whatever you’d like: - AWS Code Deploy - Fabric - Git Push - Artifact and Sync
  • 20. Demo In the next 15 minutes we will: 1. Standup local development infrastructure on Ubuntu. 1. And look at a Vagrantfile. 2. Standup identical* production infrastructure in AWS. 1. And look at a CloudFormation file. 3. Deploy code to AWS and run the same code in Dev/Prod. 1. The deployment tool is a bit of a hack, btw…