Supreet Singh - May 20, 2023
Recently at work, I've been helping a fellow engineer migrate our infrastructure at Kikoff from AWS ElasticBeanstalk to AWS Fargate. ElasticBeanstalk for Rails works great when your application is in the scale-up phase but once you have achieved a certain level of growth, it makes sense to invest in infrastructure that gives you more control over your resources and deployments. We also started using Pulumi to move us towards Infrastructure-as-Code and this is something I've been wanting to incorporate into my side projects.
So over the last few weeks, I've been learning AWS, Pulumi and all things infrastructure and will be documenting some of my learnings here.
I've been using Render for deploying my Rails applications in the past. Great application, 10/10 will use for all future projects. To learn AWS, I'm taking one of my applications on Render and moving it to AWS ECS. I chose ECS because my application is already dockerized and eventually, I want to add new features to this project using new languages I'm planning on learning (looking at you Go and Elixir). So I figured the best way of setting myself up for future success is to use a containerized approach.
Overview of the application:
Infrastructure as Code (IaC) is a key practice in the DevOps paradigm that involves managing and provisioning servers by defining the configuration in code as opposed to tinkering with your cloud provider's UI.
In simple terms, IaC is a method to automate your infrastructure setup using code. Instead of manually setting up servers, configuring networks, and managing storage, you write scripts that can perform these tasks automatically.
Pulumi, an IaC tool, takes a modern approach. While traditional IaC tools like AWS CloudFormation or Terraform use domain-specific languages (DSLs) or JSON/YAML-based configurations, Pulumi allows you to define your infrastructure in familiar general-purpose languages like JavaScript, TypeScript, Python, Go etc.
In the next post, we'll dig deeper into Pulumi and prepping our infrastructure for deployment.
Check out Part 2 here: Deploying Your Rails App to AWS with Pulumi: Part 2