This repository contains solutions for the AWS DevOps assignment including infrastructure as code, scripting, and CI/CD pipeline.
Check out the demo video to see the application in action.
/terraform- Contains Terraform configuration files for infrastructure provisioning/scripts- Contains Python scripts for AWS SDK interaction and data analysis/lambda- Contains AWS Lambda functions and tests/docs- Contains detailed documentation for each task.github/workflows- Contains CI/CD pipeline configuration
Detailed documentation for AWS resources setup is available in docs/task1_aws.md.
-
S3 Bucket
- Creation and configuration for static website hosting
- Public access configuration
- S3 Endpoint URL: http://devops-assignment-lokanath.s3-website-us-east-1.amazonaws.com/
- Screenshot:

-
EC2 Instance
- Setup with Amazon Linux
- Apache web server installation
- Simple HTML page hosting
- EC2 Public URL: http://52.202.214.202/ (Note: This link will only work when the EC2 instance is running)
- Screenshot:

-
Security Group Configuration
- HTTP traffic allowance
- IP restriction for security
-
AWS Lambda
- S3 event-triggered function
- CloudWatch logging integration
Python scripts that utilize AWS SDK (boto3) to:
-
list_s3_buckets.py
-
csv_analyzer.py
-
SDK Documentation References
- See docs/sdk_documentation.md for links to the AWS SDK documentation
GitHub Actions workflow configured to:
- Run tests on Python scripts
- Validate Terraform configurations
- Build and package Lambda functions
- Deploy to AWS (when configured)
Terraform scripts for automating AWS infrastructure:
-
AWS Resources
- EC2 instance with security group
- S3 bucket for static website
- Lambda function with CloudWatch integration
- IAM roles and policies
-
Usage
cd terraform terraform init terraform plan terraform apply
The cost analysis document provides a detailed breakdown of the annual AWS cost for this setup, including:
- EC2 Instance costs
- S3 storage and request costs
- Lambda function costs
- CloudWatch logs costs
-
Prerequisites
- AWS CLI configured with appropriate credentials
- Python 3.9 or higher
- Terraform 1.0.0 or higher
-
Install Dependencies
pip install -r requirements.txt
-
Configure AWS Credentials
aws configure
-
Deploy Infrastructure with Terraform
cd terraform terraform init terraform apply -
Run Python Scripts
python scripts/list_s3_buckets.py --bucket <your-bucket-name> python scripts/csv_analyzer.py scripts/sample_students.csv --threshold 75
-
Run Python Tests
pytest scripts/test_csv_analyzer.py pytest lambda/test_s3_event_logger.py
-
Validate Terraform
cd terraform terraform validate


