This project provisions a simple and secure AWS-based pipeline using Terraform. The architecture responds to a common data ingestion use case:
- 📤 A CSV file is uploaded to an S3 Bucket
- ⚡ That triggers an AWS Lambda function
- 🔍 The Lambda processes the file contents (e.g., reads or parses it)
- Terraform (local backend)
- AWS Lambda (Python 3.12)
- S3 with event triggers
- IAM Roles (least privilege)
git clone --branch stable https://github.com/zunderStake/xFarm.git
cd xFarm
cd lambda
zip ../lambda_function_payload.zip handler.py
cd ..
terraform init
terraform plan
terraform apply
All variables are defined in terraform.tfvars, like:
- bucket_name = "xfarm-csv-processing-bucket"
- lambda_name = "xfarmCsvProcessor"
- lambda_zip_path = "lambda_function_payload.zip"
- Least privilege IAM role for Lambda
- S3 versioning and server-side encryption (AES-256)
- Modularized Terraform code (clean structure)
- Environment variables supported via Terraform
├── lambda/ → Python function
├── modules/
│ ├── iam/ → IAM role & policies
│ ├── lambda/ → Lambda + permissions
│ └── s3/ → S3 bucket + event trigger
├── main.tf
├── variables.tf
├── outputs.tf
├── terraform.tfvars
└── README.md