SlideShare a Scribd company logo
Basic Dev Pipeline
End-to-End
Ezequiel Maraschio
> WHO?
▸ Ezequiel Maraschio > @emaraschio
▸ Software Developer > 10 years
▸ #sysarmy
▸ #nerdearla
Fullstack conf 2017 - Basic dev pipeline end-to-end
HTTP://FSC.SYSAR.MY/
Fullstack conf 2017 - Basic dev pipeline end-to-end
Fullstack conf 2017 - Basic dev pipeline end-to-end
Fullstack conf 2017 - Basic dev pipeline end-to-end
Fullstack conf 2017 - Basic dev pipeline end-to-end
HTTPS://GITHUB.COM/
EMARASCHIO/
WORKSHOP-FULLSTACK-
CONF-2017
> PATH
▸ Create React App -> Client
▸ Ruby on Rails -> API
▸ Docker & docker-compose
▸ Terraform -> Provider AWS
Fullstack conf 2017 - Basic dev pipeline end-to-end
> PATH
▸ Create React App -> Client
▸ Ruby on Rails -> API
▸ Docker & docker-compose
▸ Terraform -> Provider AWS
Fullstack conf 2017 - Basic dev pipeline end-to-end
$ npm install -g create-react-app
$ create-react-app my-app
$ cd my-app/
$ npm start
CODE
> VENTAJAS DE REACT
▸ Simple de escribir y mantener
▸ Orientado a componentes
▸ Poder usarlo dentro de otros frameworks
> DESVENTAJAS DE REACT
▸ La curva de aprendizaje puede ser
grande
▸ Solo se encarga de la vista, necesitás libs
externas para el manejo de Ajax
▸ Algo volátil
> PATH
▸ Create React App -> Client
▸ Ruby on Rails -> API
▸ Docker & docker-compose
▸ Terraform -> Provider AWS
Fullstack conf 2017 - Basic dev pipeline end-to-end
$ rails new --api notepad-api
CODE
> VENTAJAS DE RAILS
▸ Productividad
▸ Tooling
▸ Test
▸ Comunidad
> DESVENTAJAS DE RAILS
▸ Performance
▸ ORM -> Active record
> PATH
▸ Create React App -> Client
▸ Ruby on Rails -> API
▸ Docker & docker-compose
▸ Terraform -> Provider AWS
Fullstack conf 2017 - Basic dev pipeline end-to-end
Docker permite crear (y correr
código en) contenedores
Virtualizan Hardware y
corren el SO entero
Virtualizan User Space
FROM node:6.10
RUN mkdir /app
WORKDIR /app
COPY package.json package.json
COPY . /app
RUN npm install
RUN PORT=4000 npm run build
EXPOSE 4000
CMD npm start
FROM ruby:2.3.3
RUN apt-get update -qq && apt-get install -y --no-
install-recommends build-essential libpq-dev
RUN mkdir /usr/src/app
WORKDIR /usr/src/app
ADD Gemfile /usr/src/app/Gemfile
ADD Gemfile.lock /usr/src/app/Gemfile.lock
RUN bundle install --jobs 20 --retry 5
ADD . /usr/src/app
CMD rails s -b 0.0.0.0
EXPOSE 3000
$ docker build -t emaraschio/noteboard-api .
Sending build context to Docker daemon 109.1kB
Step 1/15 : FROM ruby:2.3.3
---> 0e1db669d557
(...)
Successfully built 385f71c63a97
Successfully tagged emaraschio/noteboard-
api:latest
$ docker run emaraschio/noteboard-api
=> Booting Puma
=> Rails 5.1.4 application starting in
development
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.10.0 (ruby 2.3.3-p222), codename:
Russell's Teapot
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop
DEMO
DOCKER HUB
$ docker tag api emaraschio/api:v1
$ docker push emaraschio/api:v1
Fullstack conf 2017 - Basic dev pipeline end-to-end
version: '2'
services:
api:
build: noteboard-api
image: emaraschio/noteboard-api
volumes:
- ./noteboard-api:/usr/src/app
ports:
- "3000:3000"
client:
build: noteboard-client
image: emaraschio/noteboard-client
volumes:
- ./noteboard-client:/app
ports:
- "4000:4000"
environment:
- REACT_APP_API_URL=http://localhost:3000
DEMO
> VENTAJAS DE DOCKER
▸ Velocidad
▸ Documentación
▸ Simple de usar
▸ Containers públicos
> DESVENTAJAS DE DOCKER
▸ Storage
▸ Seguridad ~
▸ Monitoreo por default
> PATH
▸ Create React App -> Client
▸ Ruby on Rails -> API
▸ Docker & docker-compose
▸ Terraform -> Provider AWS
Fullstack conf 2017 - Basic dev pipeline end-to-end
Terraform nos permite manejar
infraestructura como código
Fullstack conf 2017 - Basic dev pipeline end-to-end
Fullstack conf 2017 - Basic dev pipeline end-to-end
Fullstack conf 2017 - Basic dev pipeline end-to-end
# Configure the AWS Provider
provider "aws" {
region = "us-east-1"
}
# Create an EC2 instance
resource "aws_instance" "example_fullstack_conf" {
# AMI ID for Amazon Linux AMI 2017.09.1 (HVM)
ami = "ami-55ef662f"
instance_type = "t2.micro" # Free Tier
}
$ terraform plan
Resource actions are indicated with the following
symbols:
+ create
Terraform will perform the following actions:
+ aws_instance.example_fullstack_conf
ami: <computed>
Plan: 1 to add, 0 to change, 0 to destroy.
$ terraform apply
aws_instance.example_fullstack_conf: Creating...
ami: "" => "ami-55ef662f"
aws_instance.example_fullstack_conf: Creation
complete after 28s (ID: i-01fca7a21257cec04)
Apply complete! Resources: 1 added, 0 changed, 0
destroyed.
Fullstack conf 2017 - Basic dev pipeline end-to-end
# Configure the AWS Provider
provider "aws" {
region = "us-east-1"
}
# Create an EC2 instance
resource "aws_instance" "example_fullstack_conf" {
# AMI ID for Amazon Linux AMI 2017.09.1 (HVM)
ami = "ami-55ef662f"
instance_type = "t2.micro" # Free Tier
tags {
Name = "terraform-demo-fullstack-conf"
}
}
$ terraform plan
Resource actions are indicated with the following
symbols:
~ update in-place
Terraform will perform the following actions:
~ aws_instance.example_fullstack_conf
tags.%: "0" => "1"
tags.Name: "" => "terraform-demo-fullstack-conf"
Plan: 0 to add, 1 to change, 0 to destroy.
$ terraform apply
aws_instance.example_fullstack_conf: Refreshing
state... (ID: i-01f7cec04)
aws_instance.example_fullstack_conf: Modifying...
(ID: i-01f7cec04)
tags.%: "0" => "1"
tags.Name: "" => "terraform-demo-fullstack-conf"
aws_instance.example_fullstack_conf:
Modifications complete after 6s (ID: i-01f7cec04)
Apply complete! Resources: 0 added, 1 changed, 0
destroyed.
Fullstack conf 2017 - Basic dev pipeline end-to-end
$ terraform destroy
An execution plan has been generated and is shown
below.
Resource actions are indicated with the following
symbols:
- destroy
Terraform will perform the following actions:
- aws_instance.example_fullstack_conf
Plan: 0 to add, 0 to change, 1 to destroy.
aws_instance.example_fullstack_conf: Destruction
complete after 55s
Destroy complete! Resources: 1 destroyed.
Fullstack conf 2017 - Basic dev pipeline end-to-end
DEMO
> VENTAJAS DE TERRAFORM
▸ Muy buenas abstracciones
▸ Soporta todos los Cloud Providers del
mercado
▸ Simple y de buenas prácticas
> DESVENTAJAS DE TERRAFORM
▸ Cuidado con los state files!
▸ Constante cambio
▸ Refactor
Fullstack conf 2017 - Basic dev pipeline end-to-end
Elastic Container service (ECS) es una
manera de correr Docker en AWS
Fullstack conf 2017 - Basic dev pipeline end-to-end
ECS Overview
EC2 Instance
ECS Cluster
ECS Scheduler
ECS Agent
ECS Tasks
ECS Task Definition
{
"cluster": "example",
"serviceName": ”foo",
"taskDefinition": "",
"desiredCount": 2
}
ECS Service Definition
{
"name": "example",
"image": "foo/example",
"cpu": 1024,
"memory": 2048,
"essential": true,
}
several servers
ECS
EC2 Instance
ECS Cluster
ECS Cluster: Instancias manejadas
por el ECS
Each server must run the ECS
Agent
ECS Agent
EC2 Instance
ECS Cluster
ECS Agent: Permite ejecutar tareas
ECS Service: long-running ECS
Task & ELB settings
{
"name": "example",
"image": "foo/example",
"cpu": 1024,
"memory": 2048,
"essential": true,
}
{
"cluster": "example",
"serviceName": ”foo",
"taskDefinition": "",
"desiredCount": 2
}
ECS Agent
EC2 Instance
ECS Task Definition ECS Service Definition
ECS Cluster
ECS Task: Containers a montar
con los recursos necesarios
ECS Service: Controla y mantiene
las instancias de una tarea específica
ECS Scheduler: Deploys Tasks
across the ECS Cluster
{
"name": "example",
"image": "foo/example",
"cpu": 1024,
"memory": 2048,
"essential": true,
}
{
"cluster": "example",
"serviceName": ”foo",
"taskDefinition": "",
"desiredCount": 2
}
ECS Agent
ECS Tasks
EC2 Instance
ECS Task Definition ECS Service Definition ECS Scheduler
ECS Cluster
ECS Scheduler: Se encarga del
deploy de las tareas en el cluster
resource "aws_ecs_cluster" "example_cluster" {
name = "example-cluster"
}
resource "aws_autoscaling_group" "ecs_cluster_instances" {
name = "example-cluster-instances"
min_size = 4
max_size = 4
launch_configuration =
"${aws_launch_configuration.ecs_instance.name}"
}
Creando el cluster…
Creando la tarea…
resource "aws_ecs_task_definition" "noteboard_api"{
family = "noteboard-api"
container_definitions = <<EOF
[{
"name": "noteboard-api",
"image": "emaraschio/noteboard-api",
"cpu": 1024,
"memory": 768,
"portMappings": [{"containerPort": 3000,"hostPort": 3000}]
}]
EOF
}
Creando el Load Balancer…
resource "aws_elb" "noteboard_api" {
name = "noteboard_api"
listener {
instance_port = "3000"
instance_protocol = "http"
lb_port = "3000"
lb_protocol = "http"
}
}
Creando el servicio…
resource "aws_ecs_service" "noteboard_api" {
name = "noteboard-api"
cluster = "${aws_ecs_cluster.example_cluster.id}"
task_definition = "${aws_ecs_task_definition.noteboard_api.arn}"
desired_count = 1
load_balancer {
elb_name = "${aws_elb.noteboard_api.id}"
container_name = "noteboard-api"
container_port = 3000
}
}
CODE & DEMO
> VENTAJAS DE ECS
▸ No tiene costo extra
▸ Integra con los load-balancers
▸ Es de los cluster managers más simples
▸ Tiene auto-scaling
▸ Mucho por crecer con Kubernetes!
> DESVENTAJAS DE ECS
▸ El monitoreo es mínimo
▸ No tiene service discovery
▸ Cantidad de permisos de configuración
> PATH
▸ Create React App -> Client
▸ Ruby on Rails -> API
▸ Docker & docker-compose
▸ Terraform -> Provider AWS
¿PREGUNTAS?
> MUCHAS GRACIAS
https://sysarmy.com.ar/
http://maraschio.com/
HTTP://FSC.SYSAR.MY/

More Related Content

PDF
Terraform Introduction
PDF
Refactoring terraform
PPTX
Infrastructure as Code: Introduction to Terraform
PPTX
"Continuously delivering infrastructure using Terraform and Packer" training ...
PDF
Infrastructure as Code with Terraform
PPTX
Terraform at Scale
PDF
Intro to Terraform
PDF
Terraform at Scale - All Day DevOps 2017
Terraform Introduction
Refactoring terraform
Infrastructure as Code: Introduction to Terraform
"Continuously delivering infrastructure using Terraform and Packer" training ...
Infrastructure as Code with Terraform
Terraform at Scale
Intro to Terraform
Terraform at Scale - All Day DevOps 2017

What's hot (20)

PDF
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
PDF
Fabric Python Lib
PDF
Using Terraform.io (Human Talks Montpellier, Epitech, 2014/09/09)
PDF
Terraform in deployment pipeline
PDF
Terraform: Cloud Configuration Management (WTC/IPC'16)
PDF
Test driven infrastructure
PDF
Hashiconf EU 2019 - A Tour of Terraform 0.12
PDF
Rapid Infrastructure Provisioning
PDF
Workshop Infrastructure as Code - Suestra
PPTX
DevOps with Fabric
PPTX
Terraform day02
ODP
Integrating icinga2 and the HashiCorp suite
PDF
Everything as Code with Terraform
PPTX
Deployment with Fabric
PPTX
Terraform Immutablish Infrastructure with Consul-Template
PDF
Observability with Consul Connect
PDF
Puppet and the HashiStack
KEY
Railsconf2011 deployment tips_for_slideshare
PDF
Refactoring Infrastructure Code
PPTX
Terraform Abstractions for Safety and Power
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
Fabric Python Lib
Using Terraform.io (Human Talks Montpellier, Epitech, 2014/09/09)
Terraform in deployment pipeline
Terraform: Cloud Configuration Management (WTC/IPC'16)
Test driven infrastructure
Hashiconf EU 2019 - A Tour of Terraform 0.12
Rapid Infrastructure Provisioning
Workshop Infrastructure as Code - Suestra
DevOps with Fabric
Terraform day02
Integrating icinga2 and the HashiCorp suite
Everything as Code with Terraform
Deployment with Fabric
Terraform Immutablish Infrastructure with Consul-Template
Observability with Consul Connect
Puppet and the HashiStack
Railsconf2011 deployment tips_for_slideshare
Refactoring Infrastructure Code
Terraform Abstractions for Safety and Power
Ad

Similar to Fullstack conf 2017 - Basic dev pipeline end-to-end (20)

PPTX
An intro to Docker, Terraform, and Amazon ECS
PPTX
Amazon Web Services and Docker: from developing to production
PDF
Cutting through the fog of cloud
PPTX
Running Docker in Development & Production (#ndcoslo 2015)
PDF
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
PDF
Artem Zhurbila - docker clusters (solit 2015)
PDF
MeaNstack on Docker
PDF
Apache MXNet Distributed Training Explained In Depth by Viacheslav Kovalevsky...
PDF
What Is AWS Elastic Kubernetes Service
PPTX
Docker Security workshop slides
PDF
Microservices blue-green-deployment-with-docker
PPTX
TIAD 2016 : Migrating 100% of your production services to containers
PDF
Docker in Action
PDF
Workshop Consul .- Service Discovery & Failure Detection
PDF
Burn down the silos! Helping dev and ops gel on high availability websites
PPTX
Architecting .NET Applications for Docker and Container Based Deployments
PDF
IBM Cloud University: Build, Deploy and Scale Node.js Microservices
PDF
Docker for developers on mac and windows
PDF
Things I've learned working with Docker Support
PDF
How to create your own hack environment
An intro to Docker, Terraform, and Amazon ECS
Amazon Web Services and Docker: from developing to production
Cutting through the fog of cloud
Running Docker in Development & Production (#ndcoslo 2015)
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
Artem Zhurbila - docker clusters (solit 2015)
MeaNstack on Docker
Apache MXNet Distributed Training Explained In Depth by Viacheslav Kovalevsky...
What Is AWS Elastic Kubernetes Service
Docker Security workshop slides
Microservices blue-green-deployment-with-docker
TIAD 2016 : Migrating 100% of your production services to containers
Docker in Action
Workshop Consul .- Service Discovery & Failure Detection
Burn down the silos! Helping dev and ops gel on high availability websites
Architecting .NET Applications for Docker and Container Based Deployments
IBM Cloud University: Build, Deploy and Scale Node.js Microservices
Docker for developers on mac and windows
Things I've learned working with Docker Support
How to create your own hack environment
Ad

More from Ezequiel Maraschio (10)

PDF
Entendiendo a nuestro navegador web
PDF
Hablemos de productividad
PDF
#Sysarmy meetup 2.1 // to-do lists - arma de doble filo
PPTX
Golang Arg / CABA Meetup #5 - go-carbon
PPTX
Antipatrones en la ingeniería de software
PPTX
Como funciona tu navegador web
PPTX
Pasan cosas, cosas pasan
PPTX
Scrum inception
PPTX
Web Development introduction
PPTX
Go lang - What is that thing?
Entendiendo a nuestro navegador web
Hablemos de productividad
#Sysarmy meetup 2.1 // to-do lists - arma de doble filo
Golang Arg / CABA Meetup #5 - go-carbon
Antipatrones en la ingeniería de software
Como funciona tu navegador web
Pasan cosas, cosas pasan
Scrum inception
Web Development introduction
Go lang - What is that thing?

Recently uploaded (20)

PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Machine learning based COVID-19 study performance prediction
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Big Data Technologies - Introduction.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
cuic standard and advanced reporting.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Cloud computing and distributed systems.
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
A Presentation on Artificial Intelligence
Unlocking AI with Model Context Protocol (MCP)
Diabetes mellitus diagnosis method based random forest with bat algorithm
Machine learning based COVID-19 study performance prediction
20250228 LYD VKU AI Blended-Learning.pptx
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Spectral efficient network and resource selection model in 5G networks
Big Data Technologies - Introduction.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Digital-Transformation-Roadmap-for-Companies.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Review of recent advances in non-invasive hemoglobin estimation
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
cuic standard and advanced reporting.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Cloud computing and distributed systems.
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Building Integrated photovoltaic BIPV_UPV.pdf
A Presentation on Artificial Intelligence

Fullstack conf 2017 - Basic dev pipeline end-to-end

  • 2. > WHO? ▸ Ezequiel Maraschio > @emaraschio ▸ Software Developer > 10 years ▸ #sysarmy ▸ #nerdearla
  • 10. > PATH ▸ Create React App -> Client ▸ Ruby on Rails -> API ▸ Docker & docker-compose ▸ Terraform -> Provider AWS
  • 12. > PATH ▸ Create React App -> Client ▸ Ruby on Rails -> API ▸ Docker & docker-compose ▸ Terraform -> Provider AWS
  • 14. $ npm install -g create-react-app $ create-react-app my-app $ cd my-app/ $ npm start
  • 15. CODE
  • 16. > VENTAJAS DE REACT ▸ Simple de escribir y mantener ▸ Orientado a componentes ▸ Poder usarlo dentro de otros frameworks
  • 17. > DESVENTAJAS DE REACT ▸ La curva de aprendizaje puede ser grande ▸ Solo se encarga de la vista, necesitás libs externas para el manejo de Ajax ▸ Algo volátil
  • 18. > PATH ▸ Create React App -> Client ▸ Ruby on Rails -> API ▸ Docker & docker-compose ▸ Terraform -> Provider AWS
  • 20. $ rails new --api notepad-api
  • 21. CODE
  • 22. > VENTAJAS DE RAILS ▸ Productividad ▸ Tooling ▸ Test ▸ Comunidad
  • 23. > DESVENTAJAS DE RAILS ▸ Performance ▸ ORM -> Active record
  • 24. > PATH ▸ Create React App -> Client ▸ Ruby on Rails -> API ▸ Docker & docker-compose ▸ Terraform -> Provider AWS
  • 26. Docker permite crear (y correr código en) contenedores
  • 27. Virtualizan Hardware y corren el SO entero Virtualizan User Space
  • 28. FROM node:6.10 RUN mkdir /app WORKDIR /app COPY package.json package.json COPY . /app RUN npm install RUN PORT=4000 npm run build EXPOSE 4000 CMD npm start
  • 29. FROM ruby:2.3.3 RUN apt-get update -qq && apt-get install -y --no- install-recommends build-essential libpq-dev RUN mkdir /usr/src/app WORKDIR /usr/src/app ADD Gemfile /usr/src/app/Gemfile ADD Gemfile.lock /usr/src/app/Gemfile.lock RUN bundle install --jobs 20 --retry 5 ADD . /usr/src/app CMD rails s -b 0.0.0.0 EXPOSE 3000
  • 30. $ docker build -t emaraschio/noteboard-api . Sending build context to Docker daemon 109.1kB Step 1/15 : FROM ruby:2.3.3 ---> 0e1db669d557 (...) Successfully built 385f71c63a97 Successfully tagged emaraschio/noteboard- api:latest
  • 31. $ docker run emaraschio/noteboard-api => Booting Puma => Rails 5.1.4 application starting in development => Run `rails server -h` for more startup options Puma starting in single mode... * Version 3.10.0 (ruby 2.3.3-p222), codename: Russell's Teapot * Min threads: 5, max threads: 5 * Environment: development * Listening on tcp://0.0.0.0:3000 Use Ctrl-C to stop
  • 32. DEMO
  • 34. $ docker tag api emaraschio/api:v1 $ docker push emaraschio/api:v1
  • 36. version: '2' services: api: build: noteboard-api image: emaraschio/noteboard-api volumes: - ./noteboard-api:/usr/src/app ports: - "3000:3000" client: build: noteboard-client image: emaraschio/noteboard-client volumes: - ./noteboard-client:/app ports: - "4000:4000" environment: - REACT_APP_API_URL=http://localhost:3000
  • 37. DEMO
  • 38. > VENTAJAS DE DOCKER ▸ Velocidad ▸ Documentación ▸ Simple de usar ▸ Containers públicos
  • 39. > DESVENTAJAS DE DOCKER ▸ Storage ▸ Seguridad ~ ▸ Monitoreo por default
  • 40. > PATH ▸ Create React App -> Client ▸ Ruby on Rails -> API ▸ Docker & docker-compose ▸ Terraform -> Provider AWS
  • 42. Terraform nos permite manejar infraestructura como código
  • 46. # Configure the AWS Provider provider "aws" { region = "us-east-1" } # Create an EC2 instance resource "aws_instance" "example_fullstack_conf" { # AMI ID for Amazon Linux AMI 2017.09.1 (HVM) ami = "ami-55ef662f" instance_type = "t2.micro" # Free Tier }
  • 47. $ terraform plan Resource actions are indicated with the following symbols: + create Terraform will perform the following actions: + aws_instance.example_fullstack_conf ami: <computed> Plan: 1 to add, 0 to change, 0 to destroy.
  • 48. $ terraform apply aws_instance.example_fullstack_conf: Creating... ami: "" => "ami-55ef662f" aws_instance.example_fullstack_conf: Creation complete after 28s (ID: i-01fca7a21257cec04) Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
  • 50. # Configure the AWS Provider provider "aws" { region = "us-east-1" } # Create an EC2 instance resource "aws_instance" "example_fullstack_conf" { # AMI ID for Amazon Linux AMI 2017.09.1 (HVM) ami = "ami-55ef662f" instance_type = "t2.micro" # Free Tier tags { Name = "terraform-demo-fullstack-conf" } }
  • 51. $ terraform plan Resource actions are indicated with the following symbols: ~ update in-place Terraform will perform the following actions: ~ aws_instance.example_fullstack_conf tags.%: "0" => "1" tags.Name: "" => "terraform-demo-fullstack-conf" Plan: 0 to add, 1 to change, 0 to destroy.
  • 52. $ terraform apply aws_instance.example_fullstack_conf: Refreshing state... (ID: i-01f7cec04) aws_instance.example_fullstack_conf: Modifying... (ID: i-01f7cec04) tags.%: "0" => "1" tags.Name: "" => "terraform-demo-fullstack-conf" aws_instance.example_fullstack_conf: Modifications complete after 6s (ID: i-01f7cec04) Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
  • 54. $ terraform destroy An execution plan has been generated and is shown below. Resource actions are indicated with the following symbols: - destroy Terraform will perform the following actions: - aws_instance.example_fullstack_conf Plan: 0 to add, 0 to change, 1 to destroy. aws_instance.example_fullstack_conf: Destruction complete after 55s Destroy complete! Resources: 1 destroyed.
  • 56. DEMO
  • 57. > VENTAJAS DE TERRAFORM ▸ Muy buenas abstracciones ▸ Soporta todos los Cloud Providers del mercado ▸ Simple y de buenas prácticas
  • 58. > DESVENTAJAS DE TERRAFORM ▸ Cuidado con los state files! ▸ Constante cambio ▸ Refactor
  • 60. Elastic Container service (ECS) es una manera de correr Docker en AWS
  • 62. ECS Overview EC2 Instance ECS Cluster ECS Scheduler ECS Agent ECS Tasks ECS Task Definition { "cluster": "example", "serviceName": ”foo", "taskDefinition": "", "desiredCount": 2 } ECS Service Definition { "name": "example", "image": "foo/example", "cpu": 1024, "memory": 2048, "essential": true, }
  • 63. several servers ECS EC2 Instance ECS Cluster ECS Cluster: Instancias manejadas por el ECS Each server must run the ECS Agent ECS Agent EC2 Instance ECS Cluster ECS Agent: Permite ejecutar tareas
  • 64. ECS Service: long-running ECS Task & ELB settings { "name": "example", "image": "foo/example", "cpu": 1024, "memory": 2048, "essential": true, } { "cluster": "example", "serviceName": ”foo", "taskDefinition": "", "desiredCount": 2 } ECS Agent EC2 Instance ECS Task Definition ECS Service Definition ECS Cluster ECS Task: Containers a montar con los recursos necesarios ECS Service: Controla y mantiene las instancias de una tarea específica
  • 65. ECS Scheduler: Deploys Tasks across the ECS Cluster { "name": "example", "image": "foo/example", "cpu": 1024, "memory": 2048, "essential": true, } { "cluster": "example", "serviceName": ”foo", "taskDefinition": "", "desiredCount": 2 } ECS Agent ECS Tasks EC2 Instance ECS Task Definition ECS Service Definition ECS Scheduler ECS Cluster ECS Scheduler: Se encarga del deploy de las tareas en el cluster
  • 66. resource "aws_ecs_cluster" "example_cluster" { name = "example-cluster" } resource "aws_autoscaling_group" "ecs_cluster_instances" { name = "example-cluster-instances" min_size = 4 max_size = 4 launch_configuration = "${aws_launch_configuration.ecs_instance.name}" } Creando el cluster…
  • 67. Creando la tarea… resource "aws_ecs_task_definition" "noteboard_api"{ family = "noteboard-api" container_definitions = <<EOF [{ "name": "noteboard-api", "image": "emaraschio/noteboard-api", "cpu": 1024, "memory": 768, "portMappings": [{"containerPort": 3000,"hostPort": 3000}] }] EOF }
  • 68. Creando el Load Balancer… resource "aws_elb" "noteboard_api" { name = "noteboard_api" listener { instance_port = "3000" instance_protocol = "http" lb_port = "3000" lb_protocol = "http" } }
  • 69. Creando el servicio… resource "aws_ecs_service" "noteboard_api" { name = "noteboard-api" cluster = "${aws_ecs_cluster.example_cluster.id}" task_definition = "${aws_ecs_task_definition.noteboard_api.arn}" desired_count = 1 load_balancer { elb_name = "${aws_elb.noteboard_api.id}" container_name = "noteboard-api" container_port = 3000 } }
  • 71. > VENTAJAS DE ECS ▸ No tiene costo extra ▸ Integra con los load-balancers ▸ Es de los cluster managers más simples ▸ Tiene auto-scaling ▸ Mucho por crecer con Kubernetes!
  • 72. > DESVENTAJAS DE ECS ▸ El monitoreo es mínimo ▸ No tiene service discovery ▸ Cantidad de permisos de configuración
  • 73. > PATH ▸ Create React App -> Client ▸ Ruby on Rails -> API ▸ Docker & docker-compose ▸ Terraform -> Provider AWS