Inspiration
I wanted to understand the working of platforms like Render, Netlify etc. where they allow developers to host all their sites and backend services for free.
What it does
It is a platform that allows developers to deploy and host their static sites and web services on AWS without actually directly interacting with the same.
How I built it
I made use of Pulumi to allocate the AWS resources programmatically. Pulumi is an open source IaaC SDK that enables us to create, deploy and manage infrastructure on any cloud. I made use of GitHub APIs to fetch all the public and private repositories of the logged in user and also to fetch the contents inside the respective repository. The static sites get hosted via AWS S3 and for the web services, its docker image is created first, which is then pushed onto an AWS ECR repository which then gets hosted via AWS ECS Fargate service.
Challenges I ran into
This was my first time working with Pulumi and using AWS ECR, ECS services. There aren't enough resources available that teach how to work with these technologies and a lot of research had to be done in order to create this application. Challenges faced:
- Uploading static site contents on AWS S3 that contains multiple nested folders.
- Invoking 'Pulumi up' to update the stack's resources via code instead of CLI.
- Multiple versions of the code for the same task are available on Pulumi's site and GitHub, so finding the code that actually worked was a tedious task.
- Struggled with Pulumi's promises which it'd print as response everytime a new resource got created.
- Passing environment variables in the service to be hosted.
Accomplishments that I'm proud of
- Successfully retrieved the repository contents via GitHub API.
- Uploaded all the nested folders on the AWS S3 bucket.
- Successfully pushed the docker image to the AWS ECR repository and hosted it as a AWS ECS Fargate service which can be accessed via the load balancer's DNS name.
- Successfully created a config.json file that contained all the environment variables which were passed as parameter of the task definition.
- The user can create, edit and delete the hosted static sites and services as per requirement.
What I learned
I was working with AWS ECS and ECR services and Pulumi for the first time.
- I learnt how to create and push images on AWS ECR via Pulumi.
- I learnt what load balancers, target groups, security groups, task definitions, cluster and services are in AWS ECS.
- I learnt how to host a docker image on AWS ECS.
- I learnt how to retrieve load balancer's DNS name and S3 bucket's URL from Pulumi's promise output.
- I learnt how to work with stack in Pulumi.
What's next for Free hosting
A few improvements that it could have:
- This platform can be hosted so that it's accessible publicly.
- Free SSL certificates can be provided to hosted services.
- Logs can be made available to the user.
Log in or sign up for Devpost to join the conversation.