One step ECS deployment

AWS UG Singapore

19 April 2018

Kai Hendry

2

How evolved are you?

DevOps evolution

1. Manual
2. Configuration management {Chef,Puppet,Ansible}
3. PaaS like Dokku or Heroku
4. Docker DIY
5. Docker compose / AWS ECS / Kubernetes orchestration
6. Serverless

3

Why does Docker suck?

4

Why might you need Docker?

5

So how do you deploy Docker images on AWS?

6

AWS ECS

7

Building this out

8

ecs-cli

version: '2'
services:
    bugzilla:
      image: uneet/bugzilla-customisation
      restart: on-failure
      mem_reservation: 1g
      mem_limit: 3g # assuming a t2.medium host with 4GB of RAM
      ports:
        - 80:80
      environment:
            SES_SMTP_USERNAME: ${SES_SMTP_USERNAME}
            SES_SMTP_PASSWORD: ${SES_SMTP_PASSWORD}
            SES_VERIFIED_SENDER: ${SES_VERIFIED_SENDER}
            MYSQL_HOST: ${MYSQL_HOST}
            MYSQL_PORT: ${MYSQL_PORT}
            MYSQL_DATABASE: ${MYSQL_DATABASE}
            MYSQL_USER: ${MYSQL_USER}
            MYSQL_PASSWORD: ${MYSQL_PASSWORD}
            PARAMS_URL: ${PARAMS_URL}
            COMMIT: ${COMMIT}
      logging:
            driver: awslogs
            options:
              awslogs-region: ap-southeast-1
              awslogs-group: bugzilla
9

my own one step deploy.sh

deploy.sh

10

Travis CI

11

Notes

12

Thank you