SlideShare a Scribd company logo
Managing Microservices
using Terraform, Docker, and the Cloud
Given by Derek C. Ashmore
June 6, 2017
©2017 Derek C. Ashmore, All Rights Reserved 1
Who am I?
• Professional Geek
since 1987
• Java/J2EE/Java EE
since 1999
• Roles include:
• Developer
• Architect
• Project Manager
• Specialties
• Refactoring
• Performance
Tuning
©2017 Derek C. Ashmore, All Rights Reserved 2
Discussion Resources
• This slide deck
– http://www.slideshare.net/derekashmore
• The hands-on-lab code and setup instructions
– https://github.com/Derek-Ashmore/terraform-hands-on-lab
• The Moneta microservice (written in Java)
– https://github.com/Derek-Ashmore/moneta
• Slide deck has hyper-links!
– Don’t bother writing down URLs
©2017 Derek C. Ashmore, All Rights Reserved 3
Agenda
Microservices,
Docker, and
the Cloud
Cloud with
Terraform
Terraform’s
Competitors
Summary /
Q&A
©2017 Derek C. Ashmore, All Rights Reserved 4
What are Microservices?
• No concrete definition
• Common microservice traits
– Single functional purpose
• Most/all changes only impact one service
• Not dependent on execution context
– “loosely coupled”
– Independent process/jvm
– Stateless
– Standard Interface (typically Web Service/REST)
– Analogy: Stereo system, Linux utilities
©2017 Derek C. Ashmore, All Rights Reserved 5
Microservices Application Architecture
• Separate Databases
• Eventual Consistency
• More network activity
©2017 Derek C. Ashmore, All Rights Reserved 6
Typical Microservice Library
©2017 Derek C. Ashmore, All Rights Reserved 7
Microservice Deployments
©2016 Derek C. Ashmore, All Rights Reserved 8
Docker
• Is a “mini VM”
• runs a linux kernal
• Compare to shipping
container
• Standard “connections” to
outside world
• Supported formally by
Oracle, Tomcat, Jboss, and
many more
9©2017 Derek C. Ashmore, All Rights Reserved
Package Once, Run Anywhere!
Why Docker?
• Docker is Win-Win
– Easier for OPS and system administrators
• All software looks the same
• Standard interface for disk and network resources
– Containers can be “linked”
• Inherently automated
– Easier for developers
• Fewer environment difference issues
• Less to communicate to OPS / system administrators
• Easy to leverage work of others (docker-hub)
– If you haven’t tried Docker yet – you should!
©2017 Derek C. Ashmore, All Rights Reserved 10
Docker Build File
• Docker file for Microservice Moneta
– Base Image
• FROM java:8-jre
– Expose Folder
• VOLUME /config
– Download Moneta Jar Release
• RUN curl -SL "$MONETA_URL" -o moneta-dropwizard.jar
– Expose Ports
• EXPOSE 8080 8081
– Run It
• ENTRYPOINT exec java -classpath $CLASSPATH -server $JAVA_OPTS
• -jar moneta-dropwizard.jar server /config/moneta-dropwizard.yaml
©2017 Derek C. Ashmore, All Rights Reserved 11
Running a Docker Image
• The Docker Run Command
– Exposes Ports
– Attaches Disk
– Passes/sets Environment Variables
– Allocates Memory
• Example from the Lab Portion
– export JAVA_OPTS="-Xmx768m”
– docker pull derekashmore/moneta-dropwizard:0.9.3-alpha
– docker run -d -p 80:8080 -m 800m -e JAVA_OPTS
– -v $PWD/moneta-config:/config derekashmore/moneta-dropwizard:0.9.3-alpha
©2017 Derek C. Ashmore, All Rights Reserved 12
Typical Microservice Install at AWS
©2016 Derek C. Ashmore, All Rights Reserved 13
• Horizontal scaling is supported
• Multiple copies of microservice / web application
running at the same time
• Elastic Load Balancer distributes load across
copies of your service
• Sticky sessions available
• ELB can use health checks
• Autoscaling Groups scale number of copies up
and down based on rules you give it
• CPU Utilization or other metrics
• Autoscaling Groups distribute across availability
zones for availability
Network Security
©2017 Derek C. Ashmore, All Rights Reserved 14
Network Security (con’t)
• Public vs. Private subnets
– Specified by Routes and Network ACLs
– Public subnets can be used from the internet
• Web Servers typically placed here
– Private subnets only used within your Virtual Network
• Access from the internet just not possible
– Even if a public IP is assigned
• Microservices
• Databases
• Messaging traffic
• It’s common to add SSO (for web applications) and OAUTH (for
microservices) above that
©2017 Derek C. Ashmore, All Rights Reserved 15
Security Groups
• Security Groups provide Inbound/Outbound rules for individual instances
– Think of as “an assignable firewall”
– Multiple rules per VM allowed.
– Easy additional layer of security
– No changes to applications or services needed.
• Examples
– Web Servers  Allow port 80 and 443 from anywhere
– Web Servers  Allow SSH/SFTP only from within the VPC
• Security Groups and be associated
– Financial Microservice Allow port 443 only from VMs belonging to security group
FINANCIAL_SERVICE_CLIENT_SG
– Oracle Database  Allow port 1521 only from VMs belonging to security group
ORACLE_CLIENT_SG
©2017 Derek C. Ashmore, All Rights Reserved 16
Managing Cloud Assets
• Objectives
– Managing Complexity
• Environment Consistency
• Environment Lifecycle Support
• Ease of change
• Reuse
– Manage risk of change
– Mitigate Cloud Lock-in
• Infrastructure as Code
– Reusable Infrastructure Components
• Leverage work/expertise of others
• Big problem  Smaller manageable problems
– Change Tracking – Source Control
©2017 Derek C. Ashmore, All Rights Reserved 17
Agenda
Microservices,
Docker, and
the Cloud
Cloud with
Terraform
Terraform’s
Competitors
Summary /
Q&A
©2017 Derek C. Ashmore, All Rights Reserved 18
Terraform
• Cloud Management
– Open Source
• Very active community
– Extensible to any cloud vendor
• AWS, Azure, GCP, AliCloud, Digital Ocean, OpenStack
– Supported for Cloud Support products
• Chef, Consul, Kubernetes, Datadog
• 62 Providers as of April, 2017 and growing
©2017 Derek C. Ashmore, All Rights Reserved 19
Terraform HCL
• Declarative Language
– Describe what the end product contains
• Terraform figures out how to get there
– Terraform Resources
• Describes deployed artifacts
– Network  Virtual Networks, Subnets, Network ACLs, Gateways, ELB/ALB
– Hosts  Virtual Machines, Databases
– Security  Security groups/policies/roles/groups/users
– Much more
©2017 Derek C. Ashmore, All Rights Reserved 20
Terraform Basics
• Declarative Programming
– All *.tf files loaded  Terraform decides execution order
– No GUI  All command line and text editor
• Top Commands
– Terraform plan  Describes planned changes
– Terraform apply  Makes planned changes
– Terraform taint  Forces re-creation of a resource
– Terraform destroy  deletes all resources
©2016 Derek C. Ashmore, All Rights Reserved 21
Terraform Resources
• AWS Subnet Resource
– Count = 3  Three subnets created
– Availability Zones come from a data source (lookup)
– CIDR blocks are input variables
• Sample source
©2017 Derek C. Ashmore, All Rights Reserved 22
Terraform Data Sources
• Example Data Sources (lookups)
• Sample source
©2017 Derek C. Ashmore, All Rights Reserved 23
Terraform Providers
• Example Provider
• Sample AWS source
• Azure Provider
©2017 Derek C. Ashmore, All Rights Reserved 24
Terraform Input Variables
• Example Provider
• Sample source
©2017 Derek C. Ashmore, All Rights Reserved 25
Reusing Terraform Templates
• Example Template Reuse
• Sample source
©2017 Derek C. Ashmore, All Rights Reserved 26
Typical Project Structure
©2016 Derek C. Ashmore, All Rights Reserved 27
Terraform State
• Terraform stores state
– Local file terraform.tfstate
• Teams need to manage state centrally
– Terraform Backends
• Locks so that only one person at a time can update
• Remote storage
– S3, Azure containers, Google cloud storage, etc.
©2016 Derek C. Ashmore, All Rights Reserved 28
Agenda
Microservices,
Docker, and
the Cloud
Cloud with
Terraform
Terraform’s
Competitors
Summary /
Q&A
©2017 Derek C. Ashmore, All Rights Reserved 29
Terraform vs. Ansible/Chef
• Terraform designed for infrastructure
– Not designed for configuration management
– Terraform deploys images
• Not good at maintaining what’s on those images
• If deployments update existing VMs
– You need Ansible, Chef, or Puppet
• If deployments are “new” VMs
– Terraform can handle deployments too
©2017 Derek C. Ashmore, All Rights Reserved 30
Paradigm Shift
• Deployment as new infrastructure
– New version  new VMs
• Software versions baked into images
– Advantages
• Facilitates Canary Deployments
– Route53 Routing Policies
• Go-live operation has less risk
– Deploy/Backout is just a load balancer switch
– Disadvantages
• More moving parts
• Impossible to do manually
©2017 Derek C. Ashmore, All Rights Reserved 31
Terraform vs CloudFormation
Terraform
• Scripting skills translate to Azure,
Google Cloud, etc.
• Less verbose (>50%)
• Data Lookups
• Custom Plug-ins possible
• Active Community Support
CloudFormation
• Quicker to follow AWS enhancements
• GUI support
• Automatic centralized state
• Vendor Support
©2017 Derek C. Ashmore, All Rights Reserved 32
Further Reading
• This slide deck
– http://www.slideshare.net/derekashmore
• The Gruntwork Blog
– https://blog.gruntwork.io/
©2017 Derek C. Ashmore, All Rights Reserved 33
Questions?
• Derek Ashmore:
– Blog: www.derekashmore.com
– LinkedIn: www.linkedin.com/in/derekashmore
• Connect Invites from attendees welcome
– Twitter: https://twitter.com/Derek_Ashmore
– GitHub: https://github.com/Derek-Ashmore
– Book: http://dvtpress.com/
• This lab has set-up instructions on my git hub
– https://github.com/Derek-
Ashmore/terraform-hands-on-lab
– Google “Derek Ashmore Github”
©2016 Derek C. Ashmore, All Rights Reserved 34
HANDS-ON LAB
©2017 Derek C. Ashmore, All Rights Reserved 35
Lab Resources and Objectives
• This lab has set-up instructions on my git hub
– https://github.com/Derek-Ashmore/terraform-hands-on-lab
• You will experience
– Creating a network and deploying VMs at AWS using Terraform
– You will learn how to use Terraform Modules to leverage your code
across applications
– You will see the output of your work live on the internet.
• Java Microservice to be deployed
– https://github.com/Derek-Ashmore/moneta
©2016 Derek C. Ashmore, All Rights Reserved 36
Sample Java/EE Microservice
• Moneta – Greek goddess of ‘memory’
– Open source: https://github.com/Derek-Ashmore/moneta
• Objective:
– Provide a RESTful Web Service interface to a relational database
• Feature set:
– Provides generic ‘core’ services
– Returns Json-formatted data
– Supports startRow and maxRows query options
– Supports a security call-out
– Built-in Dropwizard, Spring Boot, and War-file deployments
• Sample contract spec – currently read-only (writes in progress)
– /moneta/topics – lists ‘topics’ of information
• E.g. – Topic Customer configured
– /moneta/topic/customers?startRow=5&maxRows=25
– /moneta/topic/customer/111-222-333
• Docker deployment
– https://hub.docker.com/r/derekashmore/moneta-dropwizard/
©2015 Derek C. Ashmore, All Rights Reserved 37
The Lab Network at AWS
©2016 Derek C. Ashmore, All Rights Reserved 38
Questions?
• Derek Ashmore:
– Blog: www.derekashmore.com
– LinkedIn: www.linkedin.com/in/derekashmore
• Connect Invites from attendees welcome
– Twitter: https://twitter.com/Derek_Ashmore
– GitHub: https://github.com/Derek-Ashmore
– Book: http://dvtpress.com/
©2016 Derek C. Ashmore, All Rights Reserved 39
terraform destroy
ADDITIONAL SLIDES FOR LONGER
PRESENTATIONS
©2017 Derek C. Ashmore, All Rights Reserved 40

More Related Content

What's hot

VMware@Night: Container & Virtualisierung
VMware@Night: Container & VirtualisierungVMware@Night: Container & Virtualisierung
VMware@Night: Container & VirtualisierungDigicomp Academy AG
 
Containers and microservices for realists
Containers and microservices for realistsContainers and microservices for realists
Containers and microservices for realistsKarthik Gaekwad
 
Docker in Production, Look No Hands! by Scott Coulton
Docker in Production, Look No Hands! by Scott CoultonDocker in Production, Look No Hands! by Scott Coulton
Docker in Production, Look No Hands! by Scott CoultonDocker, Inc.
 
Oracle database on Docker Container
Oracle database on Docker ContainerOracle database on Docker Container
Oracle database on Docker ContainerJesus Guzman
 
Intro Docker october 2013
Intro Docker october 2013Intro Docker october 2013
Intro Docker october 2013dotCloud
 
DockerCon EU 2015: Day 1 General Session
DockerCon EU 2015: Day 1 General SessionDockerCon EU 2015: Day 1 General Session
DockerCon EU 2015: Day 1 General SessionDocker, Inc.
 
Docker in pratice -chenyifei
Docker in pratice -chenyifeiDocker in pratice -chenyifei
Docker in pratice -chenyifeidotCloud
 
Docker Containers Deep Dive
Docker Containers Deep DiveDocker Containers Deep Dive
Docker Containers Deep DiveWill Kinard
 
Weave User Group Talk - DockerCon 2017 Recap
Weave User Group Talk - DockerCon 2017 RecapWeave User Group Talk - DockerCon 2017 Recap
Weave User Group Talk - DockerCon 2017 RecapPatrick Chanezon
 
DockerCon Keynote Ben Golub
DockerCon Keynote Ben GolubDockerCon Keynote Ben Golub
DockerCon Keynote Ben GolubdotCloud
 
Cloud orchestration major tools comparision
Cloud orchestration major tools comparisionCloud orchestration major tools comparision
Cloud orchestration major tools comparisionRavi Kiran
 
NetflixOSS for Triangle Devops Oct 2013
NetflixOSS for Triangle Devops Oct 2013NetflixOSS for Triangle Devops Oct 2013
NetflixOSS for Triangle Devops Oct 2013aspyker
 
Practical Container Security by Mrunal Patel and Thomas Cameron, Red Hat
Practical Container Security by Mrunal Patel and Thomas Cameron, Red HatPractical Container Security by Mrunal Patel and Thomas Cameron, Red Hat
Practical Container Security by Mrunal Patel and Thomas Cameron, Red HatDocker, Inc.
 
Alibaba Cloud Conference 2016 - Docker Enterprise
Alibaba Cloud Conference   2016 - Docker EnterpriseAlibaba Cloud Conference   2016 - Docker Enterprise
Alibaba Cloud Conference 2016 - Docker EnterpriseJohn Willis
 
Docker for any type of workload and any IT Infrastructure
Docker for any type of workload and any IT InfrastructureDocker for any type of workload and any IT Infrastructure
Docker for any type of workload and any IT InfrastructureDocker, Inc.
 
Cloud Foundry the Open PaaS - OpenTour Austin Keynote
Cloud Foundry the Open PaaS - OpenTour Austin KeynoteCloud Foundry the Open PaaS - OpenTour Austin Keynote
Cloud Foundry the Open PaaS - OpenTour Austin KeynotePatrick Chanezon
 
Orchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failuresOrchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failuresDocker, Inc.
 
Docker for the enterprise
Docker for the enterpriseDocker for the enterprise
Docker for the enterpriseBert Poller
 

What's hot (20)

7+1 myths of the new os
7+1 myths of the new os7+1 myths of the new os
7+1 myths of the new os
 
VMware@Night: Container & Virtualisierung
VMware@Night: Container & VirtualisierungVMware@Night: Container & Virtualisierung
VMware@Night: Container & Virtualisierung
 
Containers and microservices for realists
Containers and microservices for realistsContainers and microservices for realists
Containers and microservices for realists
 
Docker in Production, Look No Hands! by Scott Coulton
Docker in Production, Look No Hands! by Scott CoultonDocker in Production, Look No Hands! by Scott Coulton
Docker in Production, Look No Hands! by Scott Coulton
 
Oracle database on Docker Container
Oracle database on Docker ContainerOracle database on Docker Container
Oracle database on Docker Container
 
Intro Docker october 2013
Intro Docker october 2013Intro Docker october 2013
Intro Docker october 2013
 
DockerCon EU 2015: Day 1 General Session
DockerCon EU 2015: Day 1 General SessionDockerCon EU 2015: Day 1 General Session
DockerCon EU 2015: Day 1 General Session
 
Docker in pratice -chenyifei
Docker in pratice -chenyifeiDocker in pratice -chenyifei
Docker in pratice -chenyifei
 
Docker Containers Deep Dive
Docker Containers Deep DiveDocker Containers Deep Dive
Docker Containers Deep Dive
 
Weave User Group Talk - DockerCon 2017 Recap
Weave User Group Talk - DockerCon 2017 RecapWeave User Group Talk - DockerCon 2017 Recap
Weave User Group Talk - DockerCon 2017 Recap
 
DockerCon Keynote Ben Golub
DockerCon Keynote Ben GolubDockerCon Keynote Ben Golub
DockerCon Keynote Ben Golub
 
Cloud orchestration major tools comparision
Cloud orchestration major tools comparisionCloud orchestration major tools comparision
Cloud orchestration major tools comparision
 
NetflixOSS for Triangle Devops Oct 2013
NetflixOSS for Triangle Devops Oct 2013NetflixOSS for Triangle Devops Oct 2013
NetflixOSS for Triangle Devops Oct 2013
 
Practical Container Security by Mrunal Patel and Thomas Cameron, Red Hat
Practical Container Security by Mrunal Patel and Thomas Cameron, Red HatPractical Container Security by Mrunal Patel and Thomas Cameron, Red Hat
Practical Container Security by Mrunal Patel and Thomas Cameron, Red Hat
 
Alibaba Cloud Conference 2016 - Docker Enterprise
Alibaba Cloud Conference   2016 - Docker EnterpriseAlibaba Cloud Conference   2016 - Docker Enterprise
Alibaba Cloud Conference 2016 - Docker Enterprise
 
Securing your Containers
Securing your ContainersSecuring your Containers
Securing your Containers
 
Docker for any type of workload and any IT Infrastructure
Docker for any type of workload and any IT InfrastructureDocker for any type of workload and any IT Infrastructure
Docker for any type of workload and any IT Infrastructure
 
Cloud Foundry the Open PaaS - OpenTour Austin Keynote
Cloud Foundry the Open PaaS - OpenTour Austin KeynoteCloud Foundry the Open PaaS - OpenTour Austin Keynote
Cloud Foundry the Open PaaS - OpenTour Austin Keynote
 
Orchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failuresOrchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failures
 
Docker for the enterprise
Docker for the enterpriseDocker for the enterprise
Docker for the enterprise
 

Similar to Microservices with Terraform, Docker and the Cloud. IJug Chicago 2017-06-06

Microservices with Terraform, Docker and the Cloud. JavaOne 2017 2017-10-02
Microservices with Terraform, Docker and the Cloud. JavaOne 2017 2017-10-02Microservices with Terraform, Docker and the Cloud. JavaOne 2017 2017-10-02
Microservices with Terraform, Docker and the Cloud. JavaOne 2017 2017-10-02Derek Ashmore
 
Microservices with Terraform, Docker and the Cloud. DevOps Wet 2018
Microservices with Terraform, Docker and the Cloud. DevOps Wet 2018Microservices with Terraform, Docker and the Cloud. DevOps Wet 2018
Microservices with Terraform, Docker and the Cloud. DevOps Wet 2018Derek Ashmore
 
Managing AWS Using Terraform AWS Chicago-Suburbs 2018-01-18
Managing AWS Using Terraform AWS Chicago-Suburbs 2018-01-18Managing AWS Using Terraform AWS Chicago-Suburbs 2018-01-18
Managing AWS Using Terraform AWS Chicago-Suburbs 2018-01-18Derek Ashmore
 
Managing AWS Using Terraform AWS Atlanta 2018-07-18
Managing AWS Using Terraform AWS Atlanta 2018-07-18Managing AWS Using Terraform AWS Atlanta 2018-07-18
Managing AWS Using Terraform AWS Atlanta 2018-07-18Derek Ashmore
 
Terraform best-practices-and-common-mistakes-dev ops-west-2021
Terraform best-practices-and-common-mistakes-dev ops-west-2021Terraform best-practices-and-common-mistakes-dev ops-west-2021
Terraform best-practices-and-common-mistakes-dev ops-west-2021Derek Ashmore
 
AWS Lambda for Architects - Chicago Coder Conference -2016-06-07
AWS Lambda for Architects - Chicago Coder Conference -2016-06-07AWS Lambda for Architects - Chicago Coder Conference -2016-06-07
AWS Lambda for Architects - Chicago Coder Conference -2016-06-07Derek Ashmore
 
The Kubernetes WebLogic revival (part 1)
The Kubernetes WebLogic revival (part 1)The Kubernetes WebLogic revival (part 1)
The Kubernetes WebLogic revival (part 1)Simon Haslam
 
Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure
Devoxx France 2015 - The Docker Orchestration Ecosystem on AzureDevoxx France 2015 - The Docker Orchestration Ecosystem on Azure
Devoxx France 2015 - The Docker Orchestration Ecosystem on AzurePatrick Chanezon
 
SOA & WebLogic - Lift & Shift to the Cloud
SOA & WebLogic - Lift & Shift to the CloudSOA & WebLogic - Lift & Shift to the Cloud
SOA & WebLogic - Lift & Shift to the CloudSimon Haslam
 
Docker San Francisco Meetup April 2015 - The Docker Orchestration Ecosystem o...
Docker San Francisco Meetup April 2015 - The Docker Orchestration Ecosystem o...Docker San Francisco Meetup April 2015 - The Docker Orchestration Ecosystem o...
Docker San Francisco Meetup April 2015 - The Docker Orchestration Ecosystem o...Patrick Chanezon
 
20191201 kubernetes managed weblogic revival - part 1
20191201 kubernetes managed weblogic revival - part 120191201 kubernetes managed weblogic revival - part 1
20191201 kubernetes managed weblogic revival - part 1makker_nl
 
Oracle cloud storage and file system
Oracle cloud storage and file systemOracle cloud storage and file system
Oracle cloud storage and file systemAndrejs Karpovs
 
EMC World 2016 - code.14 Deep Dive with Mesos and Persistent Storage for Appl...
EMC World 2016 - code.14 Deep Dive with Mesos and Persistent Storage for Appl...EMC World 2016 - code.14 Deep Dive with Mesos and Persistent Storage for Appl...
EMC World 2016 - code.14 Deep Dive with Mesos and Persistent Storage for Appl...{code}
 
Unconference Round Table Notes
Unconference Round Table NotesUnconference Round Table Notes
Unconference Round Table NotesTimothy Spann
 
Platform Provisioning Automation for Oracle Cloud
Platform Provisioning Automation for Oracle CloudPlatform Provisioning Automation for Oracle Cloud
Platform Provisioning Automation for Oracle CloudSimon Haslam
 
To Build My Own Cloud with Blackjack…
To Build My Own Cloud with Blackjack…To Build My Own Cloud with Blackjack…
To Build My Own Cloud with Blackjack…Sergey Dzyuban
 
Mesosphere and Contentteam: A New Way to Run Cassandra
Mesosphere and Contentteam: A New Way to Run CassandraMesosphere and Contentteam: A New Way to Run Cassandra
Mesosphere and Contentteam: A New Way to Run CassandraDataStax Academy
 
Clocker: Managing Container Networking and Placement
Clocker: Managing Container Networking and PlacementClocker: Managing Container Networking and Placement
Clocker: Managing Container Networking and PlacementDocker, Inc.
 
Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...
Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...
Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...Cloudera, Inc.
 

Similar to Microservices with Terraform, Docker and the Cloud. IJug Chicago 2017-06-06 (20)

Microservices with Terraform, Docker and the Cloud. JavaOne 2017 2017-10-02
Microservices with Terraform, Docker and the Cloud. JavaOne 2017 2017-10-02Microservices with Terraform, Docker and the Cloud. JavaOne 2017 2017-10-02
Microservices with Terraform, Docker and the Cloud. JavaOne 2017 2017-10-02
 
Microservices with Terraform, Docker and the Cloud. DevOps Wet 2018
Microservices with Terraform, Docker and the Cloud. DevOps Wet 2018Microservices with Terraform, Docker and the Cloud. DevOps Wet 2018
Microservices with Terraform, Docker and the Cloud. DevOps Wet 2018
 
Managing AWS Using Terraform AWS Chicago-Suburbs 2018-01-18
Managing AWS Using Terraform AWS Chicago-Suburbs 2018-01-18Managing AWS Using Terraform AWS Chicago-Suburbs 2018-01-18
Managing AWS Using Terraform AWS Chicago-Suburbs 2018-01-18
 
Managing AWS Using Terraform AWS Atlanta 2018-07-18
Managing AWS Using Terraform AWS Atlanta 2018-07-18Managing AWS Using Terraform AWS Atlanta 2018-07-18
Managing AWS Using Terraform AWS Atlanta 2018-07-18
 
Terraform best-practices-and-common-mistakes-dev ops-west-2021
Terraform best-practices-and-common-mistakes-dev ops-west-2021Terraform best-practices-and-common-mistakes-dev ops-west-2021
Terraform best-practices-and-common-mistakes-dev ops-west-2021
 
AWS Lambda for Architects - Chicago Coder Conference -2016-06-07
AWS Lambda for Architects - Chicago Coder Conference -2016-06-07AWS Lambda for Architects - Chicago Coder Conference -2016-06-07
AWS Lambda for Architects - Chicago Coder Conference -2016-06-07
 
The Kubernetes WebLogic revival (part 1)
The Kubernetes WebLogic revival (part 1)The Kubernetes WebLogic revival (part 1)
The Kubernetes WebLogic revival (part 1)
 
Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure
Devoxx France 2015 - The Docker Orchestration Ecosystem on AzureDevoxx France 2015 - The Docker Orchestration Ecosystem on Azure
Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure
 
SOA & WebLogic - Lift & Shift to the Cloud
SOA & WebLogic - Lift & Shift to the CloudSOA & WebLogic - Lift & Shift to the Cloud
SOA & WebLogic - Lift & Shift to the Cloud
 
Docker San Francisco Meetup April 2015 - The Docker Orchestration Ecosystem o...
Docker San Francisco Meetup April 2015 - The Docker Orchestration Ecosystem o...Docker San Francisco Meetup April 2015 - The Docker Orchestration Ecosystem o...
Docker San Francisco Meetup April 2015 - The Docker Orchestration Ecosystem o...
 
20191201 kubernetes managed weblogic revival - part 1
20191201 kubernetes managed weblogic revival - part 120191201 kubernetes managed weblogic revival - part 1
20191201 kubernetes managed weblogic revival - part 1
 
Oracle cloud storage and file system
Oracle cloud storage and file systemOracle cloud storage and file system
Oracle cloud storage and file system
 
EMC World 2016 - code.14 Deep Dive with Mesos and Persistent Storage for Appl...
EMC World 2016 - code.14 Deep Dive with Mesos and Persistent Storage for Appl...EMC World 2016 - code.14 Deep Dive with Mesos and Persistent Storage for Appl...
EMC World 2016 - code.14 Deep Dive with Mesos and Persistent Storage for Appl...
 
Unconference Round Table Notes
Unconference Round Table NotesUnconference Round Table Notes
Unconference Round Table Notes
 
Hadoop Operations
Hadoop OperationsHadoop Operations
Hadoop Operations
 
Platform Provisioning Automation for Oracle Cloud
Platform Provisioning Automation for Oracle CloudPlatform Provisioning Automation for Oracle Cloud
Platform Provisioning Automation for Oracle Cloud
 
To Build My Own Cloud with Blackjack…
To Build My Own Cloud with Blackjack…To Build My Own Cloud with Blackjack…
To Build My Own Cloud with Blackjack…
 
Mesosphere and Contentteam: A New Way to Run Cassandra
Mesosphere and Contentteam: A New Way to Run CassandraMesosphere and Contentteam: A New Way to Run Cassandra
Mesosphere and Contentteam: A New Way to Run Cassandra
 
Clocker: Managing Container Networking and Placement
Clocker: Managing Container Networking and PlacementClocker: Managing Container Networking and Placement
Clocker: Managing Container Networking and Placement
 
Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...
Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...
Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...
 

Recently uploaded

Crafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationCrafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationWave PLM
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowPeter Caitens
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Anthony Dahanne
 
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAlluxio, Inc.
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessWSO2
 
Studiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting softwareStudiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting softwareinfo611746
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfOrtus Solutions, Corp
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamtakuyayamamoto1800
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfmbmh111980
 
iGaming Platform & Lottery Solutions by Skilrock
iGaming Platform & Lottery Solutions by SkilrockiGaming Platform & Lottery Solutions by Skilrock
iGaming Platform & Lottery Solutions by SkilrockSkilrock Technologies
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Shahin Sheidaei
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesKrzysztofKkol1
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?XfilesPro
 
Breaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdfBreaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdfMeon Technology
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandIES VE
 
Agnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in KrakówAgnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in Krakówbim.edu.pl
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTier1 app
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyanic lab
 

Recently uploaded (20)

Crafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationCrafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM Integration
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
Studiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting softwareStudiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting software
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
 
iGaming Platform & Lottery Solutions by Skilrock
iGaming Platform & Lottery Solutions by SkilrockiGaming Platform & Lottery Solutions by Skilrock
iGaming Platform & Lottery Solutions by Skilrock
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 
Breaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdfBreaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdf
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Agnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in KrakówAgnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in Kraków
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 

Microservices with Terraform, Docker and the Cloud. IJug Chicago 2017-06-06

  • 1. Managing Microservices using Terraform, Docker, and the Cloud Given by Derek C. Ashmore June 6, 2017 ©2017 Derek C. Ashmore, All Rights Reserved 1
  • 2. Who am I? • Professional Geek since 1987 • Java/J2EE/Java EE since 1999 • Roles include: • Developer • Architect • Project Manager • Specialties • Refactoring • Performance Tuning ©2017 Derek C. Ashmore, All Rights Reserved 2
  • 3. Discussion Resources • This slide deck – http://www.slideshare.net/derekashmore • The hands-on-lab code and setup instructions – https://github.com/Derek-Ashmore/terraform-hands-on-lab • The Moneta microservice (written in Java) – https://github.com/Derek-Ashmore/moneta • Slide deck has hyper-links! – Don’t bother writing down URLs ©2017 Derek C. Ashmore, All Rights Reserved 3
  • 4. Agenda Microservices, Docker, and the Cloud Cloud with Terraform Terraform’s Competitors Summary / Q&A ©2017 Derek C. Ashmore, All Rights Reserved 4
  • 5. What are Microservices? • No concrete definition • Common microservice traits – Single functional purpose • Most/all changes only impact one service • Not dependent on execution context – “loosely coupled” – Independent process/jvm – Stateless – Standard Interface (typically Web Service/REST) – Analogy: Stereo system, Linux utilities ©2017 Derek C. Ashmore, All Rights Reserved 5
  • 6. Microservices Application Architecture • Separate Databases • Eventual Consistency • More network activity ©2017 Derek C. Ashmore, All Rights Reserved 6
  • 7. Typical Microservice Library ©2017 Derek C. Ashmore, All Rights Reserved 7
  • 8. Microservice Deployments ©2016 Derek C. Ashmore, All Rights Reserved 8
  • 9. Docker • Is a “mini VM” • runs a linux kernal • Compare to shipping container • Standard “connections” to outside world • Supported formally by Oracle, Tomcat, Jboss, and many more 9©2017 Derek C. Ashmore, All Rights Reserved Package Once, Run Anywhere!
  • 10. Why Docker? • Docker is Win-Win – Easier for OPS and system administrators • All software looks the same • Standard interface for disk and network resources – Containers can be “linked” • Inherently automated – Easier for developers • Fewer environment difference issues • Less to communicate to OPS / system administrators • Easy to leverage work of others (docker-hub) – If you haven’t tried Docker yet – you should! ©2017 Derek C. Ashmore, All Rights Reserved 10
  • 11. Docker Build File • Docker file for Microservice Moneta – Base Image • FROM java:8-jre – Expose Folder • VOLUME /config – Download Moneta Jar Release • RUN curl -SL "$MONETA_URL" -o moneta-dropwizard.jar – Expose Ports • EXPOSE 8080 8081 – Run It • ENTRYPOINT exec java -classpath $CLASSPATH -server $JAVA_OPTS • -jar moneta-dropwizard.jar server /config/moneta-dropwizard.yaml ©2017 Derek C. Ashmore, All Rights Reserved 11
  • 12. Running a Docker Image • The Docker Run Command – Exposes Ports – Attaches Disk – Passes/sets Environment Variables – Allocates Memory • Example from the Lab Portion – export JAVA_OPTS="-Xmx768m” – docker pull derekashmore/moneta-dropwizard:0.9.3-alpha – docker run -d -p 80:8080 -m 800m -e JAVA_OPTS – -v $PWD/moneta-config:/config derekashmore/moneta-dropwizard:0.9.3-alpha ©2017 Derek C. Ashmore, All Rights Reserved 12
  • 13. Typical Microservice Install at AWS ©2016 Derek C. Ashmore, All Rights Reserved 13 • Horizontal scaling is supported • Multiple copies of microservice / web application running at the same time • Elastic Load Balancer distributes load across copies of your service • Sticky sessions available • ELB can use health checks • Autoscaling Groups scale number of copies up and down based on rules you give it • CPU Utilization or other metrics • Autoscaling Groups distribute across availability zones for availability
  • 14. Network Security ©2017 Derek C. Ashmore, All Rights Reserved 14
  • 15. Network Security (con’t) • Public vs. Private subnets – Specified by Routes and Network ACLs – Public subnets can be used from the internet • Web Servers typically placed here – Private subnets only used within your Virtual Network • Access from the internet just not possible – Even if a public IP is assigned • Microservices • Databases • Messaging traffic • It’s common to add SSO (for web applications) and OAUTH (for microservices) above that ©2017 Derek C. Ashmore, All Rights Reserved 15
  • 16. Security Groups • Security Groups provide Inbound/Outbound rules for individual instances – Think of as “an assignable firewall” – Multiple rules per VM allowed. – Easy additional layer of security – No changes to applications or services needed. • Examples – Web Servers  Allow port 80 and 443 from anywhere – Web Servers  Allow SSH/SFTP only from within the VPC • Security Groups and be associated – Financial Microservice Allow port 443 only from VMs belonging to security group FINANCIAL_SERVICE_CLIENT_SG – Oracle Database  Allow port 1521 only from VMs belonging to security group ORACLE_CLIENT_SG ©2017 Derek C. Ashmore, All Rights Reserved 16
  • 17. Managing Cloud Assets • Objectives – Managing Complexity • Environment Consistency • Environment Lifecycle Support • Ease of change • Reuse – Manage risk of change – Mitigate Cloud Lock-in • Infrastructure as Code – Reusable Infrastructure Components • Leverage work/expertise of others • Big problem  Smaller manageable problems – Change Tracking – Source Control ©2017 Derek C. Ashmore, All Rights Reserved 17
  • 18. Agenda Microservices, Docker, and the Cloud Cloud with Terraform Terraform’s Competitors Summary / Q&A ©2017 Derek C. Ashmore, All Rights Reserved 18
  • 19. Terraform • Cloud Management – Open Source • Very active community – Extensible to any cloud vendor • AWS, Azure, GCP, AliCloud, Digital Ocean, OpenStack – Supported for Cloud Support products • Chef, Consul, Kubernetes, Datadog • 62 Providers as of April, 2017 and growing ©2017 Derek C. Ashmore, All Rights Reserved 19
  • 20. Terraform HCL • Declarative Language – Describe what the end product contains • Terraform figures out how to get there – Terraform Resources • Describes deployed artifacts – Network  Virtual Networks, Subnets, Network ACLs, Gateways, ELB/ALB – Hosts  Virtual Machines, Databases – Security  Security groups/policies/roles/groups/users – Much more ©2017 Derek C. Ashmore, All Rights Reserved 20
  • 21. Terraform Basics • Declarative Programming – All *.tf files loaded  Terraform decides execution order – No GUI  All command line and text editor • Top Commands – Terraform plan  Describes planned changes – Terraform apply  Makes planned changes – Terraform taint  Forces re-creation of a resource – Terraform destroy  deletes all resources ©2016 Derek C. Ashmore, All Rights Reserved 21
  • 22. Terraform Resources • AWS Subnet Resource – Count = 3  Three subnets created – Availability Zones come from a data source (lookup) – CIDR blocks are input variables • Sample source ©2017 Derek C. Ashmore, All Rights Reserved 22
  • 23. Terraform Data Sources • Example Data Sources (lookups) • Sample source ©2017 Derek C. Ashmore, All Rights Reserved 23
  • 24. Terraform Providers • Example Provider • Sample AWS source • Azure Provider ©2017 Derek C. Ashmore, All Rights Reserved 24
  • 25. Terraform Input Variables • Example Provider • Sample source ©2017 Derek C. Ashmore, All Rights Reserved 25
  • 26. Reusing Terraform Templates • Example Template Reuse • Sample source ©2017 Derek C. Ashmore, All Rights Reserved 26
  • 27. Typical Project Structure ©2016 Derek C. Ashmore, All Rights Reserved 27
  • 28. Terraform State • Terraform stores state – Local file terraform.tfstate • Teams need to manage state centrally – Terraform Backends • Locks so that only one person at a time can update • Remote storage – S3, Azure containers, Google cloud storage, etc. ©2016 Derek C. Ashmore, All Rights Reserved 28
  • 29. Agenda Microservices, Docker, and the Cloud Cloud with Terraform Terraform’s Competitors Summary / Q&A ©2017 Derek C. Ashmore, All Rights Reserved 29
  • 30. Terraform vs. Ansible/Chef • Terraform designed for infrastructure – Not designed for configuration management – Terraform deploys images • Not good at maintaining what’s on those images • If deployments update existing VMs – You need Ansible, Chef, or Puppet • If deployments are “new” VMs – Terraform can handle deployments too ©2017 Derek C. Ashmore, All Rights Reserved 30
  • 31. Paradigm Shift • Deployment as new infrastructure – New version  new VMs • Software versions baked into images – Advantages • Facilitates Canary Deployments – Route53 Routing Policies • Go-live operation has less risk – Deploy/Backout is just a load balancer switch – Disadvantages • More moving parts • Impossible to do manually ©2017 Derek C. Ashmore, All Rights Reserved 31
  • 32. Terraform vs CloudFormation Terraform • Scripting skills translate to Azure, Google Cloud, etc. • Less verbose (>50%) • Data Lookups • Custom Plug-ins possible • Active Community Support CloudFormation • Quicker to follow AWS enhancements • GUI support • Automatic centralized state • Vendor Support ©2017 Derek C. Ashmore, All Rights Reserved 32
  • 33. Further Reading • This slide deck – http://www.slideshare.net/derekashmore • The Gruntwork Blog – https://blog.gruntwork.io/ ©2017 Derek C. Ashmore, All Rights Reserved 33
  • 34. Questions? • Derek Ashmore: – Blog: www.derekashmore.com – LinkedIn: www.linkedin.com/in/derekashmore • Connect Invites from attendees welcome – Twitter: https://twitter.com/Derek_Ashmore – GitHub: https://github.com/Derek-Ashmore – Book: http://dvtpress.com/ • This lab has set-up instructions on my git hub – https://github.com/Derek- Ashmore/terraform-hands-on-lab – Google “Derek Ashmore Github” ©2016 Derek C. Ashmore, All Rights Reserved 34
  • 35. HANDS-ON LAB ©2017 Derek C. Ashmore, All Rights Reserved 35
  • 36. Lab Resources and Objectives • This lab has set-up instructions on my git hub – https://github.com/Derek-Ashmore/terraform-hands-on-lab • You will experience – Creating a network and deploying VMs at AWS using Terraform – You will learn how to use Terraform Modules to leverage your code across applications – You will see the output of your work live on the internet. • Java Microservice to be deployed – https://github.com/Derek-Ashmore/moneta ©2016 Derek C. Ashmore, All Rights Reserved 36
  • 37. Sample Java/EE Microservice • Moneta – Greek goddess of ‘memory’ – Open source: https://github.com/Derek-Ashmore/moneta • Objective: – Provide a RESTful Web Service interface to a relational database • Feature set: – Provides generic ‘core’ services – Returns Json-formatted data – Supports startRow and maxRows query options – Supports a security call-out – Built-in Dropwizard, Spring Boot, and War-file deployments • Sample contract spec – currently read-only (writes in progress) – /moneta/topics – lists ‘topics’ of information • E.g. – Topic Customer configured – /moneta/topic/customers?startRow=5&maxRows=25 – /moneta/topic/customer/111-222-333 • Docker deployment – https://hub.docker.com/r/derekashmore/moneta-dropwizard/ ©2015 Derek C. Ashmore, All Rights Reserved 37
  • 38. The Lab Network at AWS ©2016 Derek C. Ashmore, All Rights Reserved 38
  • 39. Questions? • Derek Ashmore: – Blog: www.derekashmore.com – LinkedIn: www.linkedin.com/in/derekashmore • Connect Invites from attendees welcome – Twitter: https://twitter.com/Derek_Ashmore – GitHub: https://github.com/Derek-Ashmore – Book: http://dvtpress.com/ ©2016 Derek C. Ashmore, All Rights Reserved 39 terraform destroy
  • 40. ADDITIONAL SLIDES FOR LONGER PRESENTATIONS ©2017 Derek C. Ashmore, All Rights Reserved 40