A lightweight, serverless Infrastructure-as-Code setup powered by GitHub Actions and Terraform — using a single S3 backend. Simple, elegant, and entirely cloud-native.
This project automates AWS infrastructure provisioning using Terraform with a unified S3 backend. It supports EC2 instance creation, S3 bucket provisioning, secure key management, and email notifications — all orchestrated via GitHub Actions.
The workflow supports dynamic inputs to customize each run:
yes/no — to create or destroy resources.all/ec2/s3 — to specify which module to run.These inputs make the workflow reusable for multiple environments and purposes — from sandbox deployments to automated teardown.
This approach keeps the infrastructure minimal and universally deployable — Terraform as code, not as overhead.
cd backend && terraform init && terraform apply -auto-approvetf-key.pem securely stored as workflow artifact.{
"instance_id": "i-0abc12345def67890",
"public_ip": "13.233.115.21",
"bucket_name": "terraform-ci-demo-bucket"
}
Each module begins with this minimal backend block:
terraform {
backend "s3" {}
required_providers {
aws = { source = "hashicorp/aws" }
}
}
GitHub Actions injects backend parameters like bucket, key, and region automatically during each run.