Harnessing the Power of the Three Musketeers with Terraform
Pre-requisites
- Docker
- docker-compose
- AWS CLI
- AWS Account
- Curl/Postman or any other HTTP client
In essence, this blog post showcases the powerful synergy of the Three Musketeers pattern (Docker, docker-compose, Makefile) when combined with Terraform. I firmly believe that this blend significantly simplifies the process of terraforming. If an individual wishes to modify the code, they simply need to delve into AWS and construct a Docker image.
Dockerfile:
FROM hashicorp/terraform:1.2.4
WORKDIR /infra
ENTRYPOINT [""]
ENV PYTHONUNBUFFERED=1
RUN \
apk update && \
apk add --no-cache python3 curl bash py-pip jq && \
ln -sf python3 /usr/bin/python && \
python3 -m ensurepip && \
apk add --virtual=build gcc libffi-dev musl-dev openssl-dev python3-dev make curl && \
pip3 install awscli --no-cache-dir && \
apk del --purge build
COPY ./ ./
In this Docker, we’re utilizing the Terraform image, ensuring everyone operates on the same Terraform version. It’s evident that it sets up the AWS CLI. Therefore, if you’re considering working with different cloud platforms, it would be beneficial to install their respective CLIs as well.
The GitHub repository, https://github.com/KamilBlaz/api_gw_lambda, provides a comprehensive guide in its README on initiating a project of this nature. This project focuses on the creation of an API gateway and Lambda, offering a valuable hands-on experience.
Summary
In this article, I showed you can leverage the Three Musketeers pattern to simplify the process of terraforming.
Related Posts
Local Development - AWS Lambda RIE
In this comprehensive guide, we will explore the concept of local development for AWS Lambda functions using the Runtime Interface Emulator (RIE). Developing and testing Lambda functions locally can be challenging without the right tools. This is where the AWS Lambda RIE comes into play.
Atlas - manage your database schema as code
Manage database migration schemas using the declarative approach in the modern DevOps world.