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

New
ErlangSolutions
If anyone is interested in joining our next webinar with Bruce Tate :backhand_index_pointing_right:registration is now open! RSVP and lea...
New
ryan-senn
I’m learning Elixir and started to go through the Project Euler problems. While the problems are great, the UX is very limited. I’ve buil...
New
yfractal
Elixir/Erlang is really good at concurrency. But there is not much stuff about the internal and implementation. So I created a repo aw...
New
hectorperez
Hi, I found that a great way to learn is: play with existing livebook notebooks create new notebooks — completely new or just changing ...
New
Timtonix
A tous les français de la communauté Elixir, J’ai découvert hier ce livre traitant d’élixir Elixir - Un langage de programmation 100 %...
New
halostatue
I wanted to share an exercise I did that I found useful for refining my knowledge of SQL internal implementations and list comprehensions...
New

Other popular topics Top

joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New

We're in Beta

About us Mission Statement