September 3rd, 2018
DevOps: Learning Terraform
Ever since I first heard about infrastructure as code (IaC) and Terraform 9 months ago, I’ve been intrigued by what the fuss is all about. I always developed software and nothing more. Digging through Linux or setting up email servers are things I have nightmares about. When told that learning operations is important for developers and warned of the combination of developer and operations (DevOps), I kindly said "no thank you, operations are not for me."
With my first website SaintsXCTF, I was exposed to the world of setting up linux servers to host websites. I set up an Apache web server with DNS routing and stumbled through a Postfix mail transferring agent. I felt very accomplished by all that, but quickly shifted my focus back to developing software. After all, writing code is what I love to do!
With my second website (which you are currently viewing) I started working in the cloud with AWS. I didn't enjoy my time clicking through the AWS UI, picking EC2 instances to start up and configuring S3 buckets. Clicking through a website to configure cloud infrastructure isn't fun, writing code is. If only I could configure all my infrastructure by writing code!
June 17th, 2019
Creating a Reusable Terraform Module
When programming with Terraform, I often find myself writing the same code again and again. In order to maintain the DRY principal in Terraform configuration, modules are used to encapsulate logic and design a layer of abstraction for infrastructure code. This article explains how I created Terraform modules that are reused throughout my AWS Infrastructure as Code.
DRY stands for "Do not Repeat Yourself." It's the design philosophy that similar code shouldn't exist in multiple locations. Instead, repeated code segments should be combined into a single component or function.
September 28th, 2020
Building an AWS EKS cluster with Terraform
Recently I made the decision to move my applications to Kubernetes, specifically hosted in an EKS cluster on AWS. Before making this decision, my applications (saintsxctf.com and jarombek.com) were hosted using different methods. saintsxctf.com was hosted on autoscaled AWS EC2 instances and jarombek.com was hosted on AWS ECS. I also had prototypes using different hosting methods and a Jenkins server which was hosted on EC2 instances. Moving all these applications to Kubernetes unifies the deployment process and allows me to take advantage of containerization and container orchestration.
In this article, I'll discuss the process for setting up my EKS cluster with Terraform. I'll also detail my experience deploying ALB Ingress Controller and External DNS pods on the cluster.
September 7th, 2018
Using AWS Lambda with API Gateway and Terraform
Traditionally when building a mobile app or website, the application is split into a few different layers. The necessary layers commonly comprise a front-end, backend, and database. In recent years, the backend is often a REST API that makes requests to a database. The front-end communicates with the REST API through HTTP requests.
To set up a REST API, a server is needed to host backend code. Using a backend server means app developers have to spend time managing infrastructure. As I mentioned in my post on Terraform, when cloud computing came along new techniques for handling infrastructure were introduced. With AWS Lambda, we have a new technique for handling code and infrastructure in our backend. AWS Lambda introduces containerized functions and serverless computing.
April 8th, 2019
Docker Part II - Building a Playground Environment
In my previous post about Docker, I explored the basic concepts of Docker containers. In this post, I'm creating a Docker playground environment on AWS with Terraform and CloudFormation. The playground consists of an EC2 instance with Docker installed. It's accessible from the internet to facilitate containerized web applications. To start I'll discuss why I used Terraform and CloudFormation to build the playground. Then I'll take a deep dive into the infrastructure code.
September 29th, 2020
Jenkins Server Modern Infrastructure with Kubernetes on EKS
In a prior article, I discussed a Jenkins server I created on AWS EC2 and EFS. In this article I’ll discuss the second generation of that infrastructure, which uses Docker containers orchestrated by Kubernetes on an EKS cluster.
October 1st, 2020
Interesting AWS Jenkins Jobs
I recently built a new Jenkins server hosted using Kubernetes on EKS. My main use of the Jenkins server is to automate application and infrastructure tests, deployments, and miscellaneous tasks. I get email notifications if these jobs fail, so I know when there is an issue with my software.
Many of my Jenkins jobs work with the AWS CLI and Terraform to interact with and manipulate my cloud infrastructure. I believe these jobs may be useful as templates for others wishing to achieve similar results.
September 27th, 2020
Jenkins Server Legacy Infrastructure on EC2 and EFS
Back in 2018, I created a Jenkins server which automated tasks for my applications. Jenkins is a continuous integration and continuous delivery (CI/CD) tool which I've written about in the past. When I first created the Jenkins server, I had a few jobs which ran unit tests, but I never took full advantage of them. Over the past two years, I've gained a greater appreciation for CI/CD tools and their ability to save time deploying code and building confidence in codebases by automating tests. Nowadays all my applications have automated test and deployment jobs on Jenkins.
Since 2018 the Jenkins ecosystem has evolved along with my understanding of cloud concepts. My original Jenkins server was hosted on an AWS EC2 instance which utilized AWS EFS for persistent storage. In the spring of 2020, I decided to rewrite the Jenkins server infrastructure. With my added knowledge of containerization with Docker and container orchestration with Kubernetes, I hosted the Jenkins server on AWS EKS as part of a Kubernetes deployment. In this article, I discuss the original EC2 Jenkins server and its creation process with Terraform. In an upcoming article, I'll discuss the Kubernetes Jenkins server infrastructure.
September 5th, 2019
AWS Lambda Function for MySQL RDS Backups Part II: Building the Function
In my previous article I discussed my existing AWS infrastructure and the additional resources needed to automate backups for a RDS MySQL instance using a lambda function. In this article I'll create those additional resources and further explain my design decisions. Finally, I'll test the lambda function and show the backup file in my S3 bucket.
September 15th, 2019
Introduction to Elasticsearch
Over the past few months I've read a book about the ELK stack. ELK stands for Elasticsearch, Logstash, and Kibana. Together these three technologies provide the ability to search, stream, and visualize data. In this article I discuss Elasticsearch, which is the core technology of ELK Stack. First I'll define Elasticsearch and provide details about what its used for. Second I'll create AWS infrastructure for Elasticsearch using Amazon Elasticsearch Service. Third and finally I'll populate Elasticsearch with data and show some basic queries.
February 15th, 2020
Hosting a Static React Application on Amazon S3
Amazon S3 (Simple Storage Service) is an AWS service for storing objects. Since objects are files, S3 can be viewed as a filesystem accessible over HTTP. I often use S3 for storing images, fonts, and other assets for my applications. Some examples include my jarombek.com assets and my global shared assets.
Since Amazon S3 stores files and acts as a filesystem, it can also be used to host static websites.
October 28th, 2019
Unit Testing AWS Infrastructure with Python
From October 2018 to May 2019, I moved the infrastructure for both my websites to AWS. The process for building and tearing down this infrastructure is automated with IaC, specifically Terraform. I've had a lot of fun working with Terraform and learning the different design patterns for infrastructure in the cloud.
After my infrastructure was built, I realized I needed a way to test that my IaC was behaving as expected. The obvious solution to this requirement was a unit test suite. I implemented this unit test suite in Python with the help of the AWS SDK. This article explains why I took the time to write unit tests and walks through of the basics of testing AWS infrastructure in Python.