Skip to content

dataops-sre/infra-bootstrap

Repository files navigation

Infra as code bootstrap

This repository provides a ready-to-use Infrastructure as Code (IaC) bootstrap template using Terragrunt and Terraform to deploy AWS infrastructure (VPC, EKS, budgets, Kubernetes base config, namespaces) in a modular and reusable way.

It supports spot instances, autoscales based on cluster load, configures AWS budget alerting, and is designed to make use of AWS Free Tier resources as much as possible.

All tooling (Terraform, Terragrunt, AWS CLI helpers) is packaged in a Docker image: devopsinfra/docker-terragrunt This ensures:

  • No manual local installs required
  • Consistent developer environments
  • Identical local and CI environments

Components

Infrastructure components:

Software components:

How to use

The project use the standard terragrunt project structure, detailed explication here.

Prerequisites

  • AWS CLI configured with necessary permissions
  • Docker & Docker Compose 3.x: For creating consistent, reproducible environments for the application, tests, and development (Jupyter).
  • Taskfile: A simple, make-like build tool for automating common commands (e.g., running the job, tests).

Note: You do not need to install Terraform or Terragrunt locally. All commands run inside devopsinfra/docker-terragrunt to guarantee consistent versions between local and CI.

Typical local workflow

  1. Assume your AWS admin role, make sure you have AWS environments variables with shell
❯ env | grep AWS
AWS_ACCESS_KEY_ID=xxxxxx
AWS_SECRET_ACCESS_KEY=xxxxxx
AWS_SESSION_TOKEN=xxxxxx
  1. Run format check: task fmt

  2. Validate configuration task validate

  3. Plan infrastructure changes: task plan

  4. Apply infrastructure changes: task apply

  5. Configure kubectl:

aws eks --region eu-west-1 update-kubeconfig --name <cluster-name>
  1. Verify cluster and pods:
kubectl get pods -n kube-system
kubectl get pods -n default

CI/CD Integration

The file format validation is run on pull requests to ensure code consistency and prevent formatting drift.

Cost Management

This IaC setup also provisions AWS Budgets to send alerts when costs approach or exceed defined thresholds. Where possible, it uses AWS Free Tier–eligible services and configurations to minimize costs during development and testing.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages