{"id":13623887,"url":"https://github.com/brikis98/infrastructure-as-code-talk","last_synced_at":"2025-04-05T02:10:49.422Z","repository":{"id":80965270,"uuid":"54501548","full_name":"brikis98/infrastructure-as-code-talk","owner":"brikis98","description":"Sample code for the talk \"Infrastructure-as-code: running microservices on AWS with Docker, ECS, and Terraform\"","archived":false,"fork":false,"pushed_at":"2018-02-14T12:09:26.000Z","size":752,"stargazers_count":573,"open_issues_count":0,"forks_count":164,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-03-29T01:13:09.323Z","etag":null,"topics":["aws","docker","ecs","microservices","samples","talk","terraform"],"latest_commit_sha":null,"homepage":"http://www.ybrikman.com/writing/2016/03/31/infrastructure-as-code-microservices-aws-docker-terraform-ecs/","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brikis98.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-03-22T19:05:22.000Z","updated_at":"2024-11-07T19:01:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"278af17c-7e41-495f-b24f-fbb945d8d897","html_url":"https://github.com/brikis98/infrastructure-as-code-talk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brikis98%2Finfrastructure-as-code-talk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brikis98%2Finfrastructure-as-code-talk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brikis98%2Finfrastructure-as-code-talk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brikis98%2Finfrastructure-as-code-talk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brikis98","download_url":"https://codeload.github.com/brikis98/infrastructure-as-code-talk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276189,"owners_count":20912288,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","docker","ecs","microservices","samples","talk","terraform"],"created_at":"2024-08-01T21:01:36.672Z","updated_at":"2025-04-05T02:10:49.404Z","avatar_url":"https://github.com/brikis98.png","language":"HCL","funding_links":[],"categories":["HCL"],"sub_categories":[],"readme":"# Infrastructure as Code Talk\n\nThis repo contains the sample code for the talk [Infrastructure-as-code: running microservices on AWS with Docker,\nTerraform, and ECS](http://www.ybrikman.com/writing/2016/03/31/infrastructure-as-code-microservices-aws-docker-terraform-ecs/).\nIt includes a couple sample Dockerized microservices and the Terraform code to deploy them on AWS:\n\n![Architecture](/_docs/architecture.png)\n\n**Note**: This repo is for demonstration purposes only and should NOT be used to run anything important. For\nproduction-ready version of this code and many other types of infrastructure, check out \n[Gruntwork](http://www.gruntwork.io/).\n\n\n\n## Quick start\n\n\n### Running the microservices locally\n\nTo run the rails-frontend and sinatra-backend on your local dev box:\n\n1. Install [Docker](https://www.docker.com/). \n2. `docker-compose up`\n3. Test sinatra-backend by going to http://localhost:4567.\n4. Test the rails-frontend (and its connectivity to the sinatra-backend) by going to http://localhost:3000.\n\nThe `docker-compose.yml` file mounts `rails-frontend` and `sinatra-backend` folders as volumes in each Docker image, so\nany changes you make to the apps on your host OS will automatically be reflected in the running Docker container. This\nlets you do iterative \"make-a-change-and-refresh\" style development.\n\n\n\n\n\n### Deploying the microservices in AWS\n\nTo deploy the microservices to your AWS account, see the [terraform-configurations README](./terraform-configurations).\n\n\n\n\n\n### Using your own Docker images\n\nBy default, [docker-compose.yml](./docker-compose.yml) and the [terraform-configurations](./terraform-configurations) \nare using the `gruntwork/rails-frontend` and `gruntwork/sinatra-backend` Docker images. These are images I pushed to \nthe [Gruntwork Docker Hub account](https://hub.docker.com/r/gruntwork/rails-example-app/) to make it easy for you to \ntry this repo quickly. Obviously, in the real world, you'll want to use your own images instead.\n\nFollow Docker's documentation to [create your own Docker\nimages](https://docs.docker.com/engine/userguide/containers/dockerimages/) and fill in the new image id and tag in:\n\n1. `docker-compose.yml`: the `image` attribute for `rails_frontend` or `sinatra_backend`.\n2. `terraform-configurations/terraform.tfvars`: the `rails_frontend_image` and `rails_frontend_version` or\n   `sinatra_backend_image` and `sinatra_backend_version` variables.\n\n\n\n\n## Overview of the repo\n\nHere's an overview of what's in this repo:\n\n1. An example [sinatra-backend microservice](./sinatra-backend) that just returns the text \"Hello, World\". This app\n   includes a [Dockerfile](./sinatra-backend/Dockerfile) to package it as a Docker container.\n\n1. An example [rails-frontend microservice](./rails-frontend) that makes an HTTP call to the sinatra-backend and\n   renders the result as HTML. This app includes a [Dockerfile](./rails-frontend/Dockerfile) to package it as a Docker\n   container.\n\n1. A [docker-compose.yml](./docker-compose.yml) file to deploy both Docker containers so you can see how the two\n   microservices work together in the development environment. To allow the services to talk to each other, we are\n   using [Docker Links](https://docs.docker.com/engine/userguide/networking/default_network/dockerlinks/) as a simple\n   \"service discovery\" mechanism.\n\n1. [Terraform configurations](./terraform-configurations) to deploy both Docker containers on Amazon's\n   [EC2 Container Service (ECS)](https://aws.amazon.com/ecs/) so you can see how the two microservices work together in\n   the production environment. To allow the services to talk to each other, we deploy an [Elastic Load Balancer\n   (ELB)](https://aws.amazon.com/elasticloadbalancing/) in front of each service and use Terraform to pass the ELB\n   URLs between services. We are using the same environment variables as Docker Links, so this acts as a simple\n   \"service discovery\" mechanism that works in both dev and prod.\n\n\n\n\n## More info\n\nFor more info, check out the talk [Infrastructure-as-code: running microservices on AWS with Docker, Terraform, and\nECS](http://www.ybrikman.com/writing/2016/03/31/infrastructure-as-code-microservices-aws-docker-terraform-ecs/),\nincluding [the video](https://vimeo.com/167706949) and\n[slides](http://www.slideshare.net/brikis98/infrastructure-as-code-running-microservices-on-aws-using-docker-terraform-and-ecs?ref=http://www.ybrikman.com/writing/2016/03/31/infrastructure-as-code-microservices-aws-docker-terraform-ecs/).\nFor a deeper look at Terraform, check out the book *[Terraform: Up \u0026 Running](http://www.terraformupandrunning.com/)*.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrikis98%2Finfrastructure-as-code-talk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrikis98%2Finfrastructure-as-code-talk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrikis98%2Finfrastructure-as-code-talk/lists"}