This repository contains Dockerfiles and scripts to set up Terraform with Atlantis for managing infrastructure on AWS Fargate. Atlantis is a tool that automates Terraform workflows via pull requests on your Git repository.
Before using this repository, you should have the following prerequisites in place:
- AWS Access and Secret Access Key for Terraform operations.
- GitHub credentials for authentication.
- Docker installed on your system.
Create a .env
file in both the create/
and destroy/
directories, and provide the following variables:
AWS_ACCESS_KEY_ID=YOUR_AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY=YOUR_AWS_SECRET_ACCESS_KEY
GITHUB_USER=YOUR_GITHUB_USERNAME
GITHUB_TOKEN=YOUR_GITHUB_PERSONAL_ACCESS_TOKEN
Replace YOUR_AWS_ACCESS_KEY_ID
, YOUR_AWS_SECRET_ACCESS_KEY
, YOUR_GITHUB_USERNAME
, and YOUR_GITHUB_PERSONAL_ACCESS_TOKEN
with your actual credentials.
There are two Dockerfiles provided in this repository: one for creating resources create/
and another for destroying resources destroy/
.
To build the Dockerfiles, navigate to the respective directory and run the following command:
docker build -t atlantis-create .
# or
docker build -t atlantis-destroy .
To run Terraform with Atlantis for creating resources:
docker run atlantis-create
To run Terraform with Atlantis for destroying resources:
docker run atlantis-destroy