Skip to content

288milan/devops-challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Particle41 DevOps Team Challenge

Summary

This repository contains a complete DevOps setup for deploying a SimpleTimeService on AWS using ECS and an Application Load Balancer.

It includes:

  1. Python web application that returns a pure JSON response with the following structure:
{
  "timestamp": "<current date and time>",
  "ip": "<IP address of the visitor>"
}
  1. Dockerfile to build the container image
  2. Terraform code to provision AWS infrastructure using ECS and an Application Load Balancer (ALB)

Tech Stack

  • Language: Python
  • Web Framework: Flask (simple HTTP service)
  • Containerization: Docker
  • Cloud Provider: AWS
  • Container Orchestration: Amazon ECS
  • Load Balancer: Application Load Balancer (ALB)

Project Structure

.
├── app/         # Application source code and Dockerfile
└── terraform/   # Terraform infrastructure code

Prerequisites

Make sure you have the following installed:

  • Git
  • Docker
  • Terraform
  • AWS CLI

How to Use

Clone the Repository

git clone https://github.com/288milan/devops-challenge.git
cd devops-challenge

🐳 Build the Docker Image

cd app
docker buildx build -t <image_name>:<tag> .

Replace <image_name> and <tag> accordingly.


Push Image to Docker Hub

docker login

docker tag <image_name>:<tag> <dockerhub-username>/<repository-name>:<tag>
docker push <dockerhub-username>/<repository-name>:<tag>

Run Locally

docker run -d -p 8080:8080 <image_name>:<tag>

Open your browser and visit:

http://localhost:8080

AWS Cloud Provisioning Using Terraform

Terraform Environment Variables

The following variables are required:

  1. region – AWS region where resources will be deployed
  2. availability_zones – Availability Zones where the subnets are created
  3. project_name – Used for naming, tagging, and identifying AWS resources
  4. container_image – SimpleTimeService application container image used in ECS task

update the "terraform.tfvars" variable file as required before terraform apply


Deploy Infrastructure

cd terraform
terraform init
terraform plan
terraform apply

Access the Application

Once deployment is complete, Terraform will output the ALB DNS name.

Open the URL in your browser to access the SimpleTimeService:

http://<alb-dns-name>

Make sure to use HTTP, not HTTPS, unless SSL is explicitly configured.


About

SimpleTimeService

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published