danschultzer

danschultzer

Pow Core Team

Terraform, AWS ECS, Github Actions, clustering, and more DevOps fun!

TLDR

This repo got all Terraform IaC files to setup AWS ECS for Elixir apps that includes web server(s) and database. It includes auto deployment with Github Actions, and shows how to deal with exposing multiple ports and blue-green deployment strategy.

https://github.com/danschultzer/elixir-terraform-aws-ecs-example

Background

AWS is an insane timesink. There are only few articles that detail full Terraform setups and all were missing different pieces that I needed to have a full production setup. I spend so much time trying to understand how to setup infrastructure properly and deploy to ECS. To save others from this pain I’ve put it all together in a repo detailing step by step with git commits how to set up an Elixir project with Terraform code for continuous delivery.

In our company we use it for umbrella projects with multiple Phoenix apps. Unfortunately AWS is very microservice happy so it’s not an ideal setup with multiple task files and deployment steps. But it works!

Furthermore I’ve enabled CI testing of this repo using LocalStack simulating AWS. So you can be sure that the IaC files in the repo actually works.

I’ve also tried to set up logic that creates a phoenix app from scratch and deploys it right there in Github Actions validating that it connects to db and other nodes :exploding_head: Unfortunately LocalStack has a bunch of issues around this so won’t work for a while.

I’ll keep updating the the repo as I learn from dealing with AWS. Let me know what you think!

Most Liked

Raees678

Raees678

This is awesome!

soyjeansoy

soyjeansoy

woot lots to learn!

Last Post!

acrolink

acrolink

Thanks, looking forward to try this. I have two questions:

  1. Does this take care of generating and using SSL certificates for accessing the load balancer from the internet?
  2. How to create PostgreSQL Aurora serverless RDS instances using terraform ?

Where Next?

Popular in Other Resources Top

zenw0lf
Hello all! I just finished a full step-by-step tutorial on how to build a JSON API with Phoenix: https://lobotuerto.com/blog/building-a...
New
landonwilkins
Hi! My apartment’s walls are blank. I want to fill at least one with Elixir diagrams. Links to Diagrams GitHub - benjamintanweihao/eli...
New
wolfiton
Cool way to learn flexbox and have fun at the same time. https://mastery.games/p/flexbox-zombies
New
D4no0
This is a little bit offtopic. I would like to make a relative UI renderer (similar to the ones present on maket: android, IOS, WPF) for...
New
ericdouglas
I’m very happy to launch this project since it is a culmination of several years of a self-knowledge process and acquired experience in s...
New
ErlangSolutions
We’re excited to announce that Juliana Helena will be joining us on the webinar this month. She’ll be expanding on the talk she gave at ...
New
djaouen
Has anyone seen this paper on static typing for Elixir? It kind of goes over my head, but I’m interested in what the community thinks ab...
New

Other popular topics Top

New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 54921 245
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New

We're in Beta

About us Mission Statement