Project: Deploy Udagram an Image filtering Application on AWS

Jonah Apagu
3 min readAug 1, 2022

Project Overview

This was the second project I completed while undertaking the Udacity cloud developer Nanodegree program sponsored by ALX-T. Udagram is a cloud-based application for uploading, listing, and filtering images. In this project, Node.js/Express, a popular JavaScript framework for networked application development was used to develop the Udagram application. A REST API to issue commands using HTTP, and store data in Amazon Web Services (AWS) Relational Data Service (RDS) and S3 bucket was implemented. Secure authentication sign-on features were also implemented in the codebase and the application deployed to AWS Elastic Beanstalk. Elastic Beanstalk is an orchestration service that allows users to deploy a web application at the touch of a button by spinning up (or provisioning) all of the services that are needed to run the application.

Prerequisites

Project steps

In this project, I deployed the full-stack image filtering app Udagram on AWS using the following steps;

  • I Setup the node environment by running the following commands;
  1. ‘npm i’ to install all the project dependencies as specified in the package.json file.
  2. ‘npm run dev’ to run the dev script specified in the package.json file to start the application server locally.
Server Running Locally
  • Implemented a new restful endpoint in the server.ts file of the project which uses a query parameter to download an image from a public URL, filter the image, and return the result.
  • Deployed the Application to Elastic Beanstalk using the following steps;
  1. Configured AWS CLI using IAM user credentials.
  2. Attached “AdministratorAccess-AWSElsaticBeanstalk” policy to the IAM user using AWS Management console to give the IAM user full access to use Elastic Beanstalk services.
  3. Attached “AdministratorAccess” permission to the IAM user to enable the user deploy a load balancer for the application on Elastic Beanstalk, the “AdministratorAccess” policy was removed after deployment.
  4. Installed Elastic Beanstalk CLI using the command “pip install awsebcli — upgrade — user”.
  5. Initialized the Elastic Beanstalk application with details such as region of deployment, application name, and keypair using the “eb init” command. This created a new directory in the project named “.elasticbeanstalk”. Within the created directory is a configuration file named config.yml. This yaml file contains the set of instructions Elastic Beanstalk will follow when provisioning the AWS infrastructure and deploying the code.
  6. The Artifact method of deploying code on Elastic Beanstalk was specified on the config.yml file which allows the code to be built locally and packaged into an Archive.zip file.
  7. “npm run build” command was used to package the code into a usable format as specified in the package.json file.
  8. The Elastic Beanstalk environment for the deployment of the application was created using the “eb create” command.
  9. I then configured the deployed Elastic Beanstalk environment variables on AWS console with the postgres database and s3 bucket details.
  10. Attached a policy granting access to S3 buckets to the generated Elastic Beanstalk IAM role attached to the deployed elastic beanstalk environment.
Deployed application
  • The API endpoint of the newly deployed application was then tested using the Elastic Beanstalk’s endpoint URL with Postman.
Elastic Beanstalks endpoint url tested
  • After the project was reviewed and passed all running resources were shut down and deleted.

Google Docs Link

Project’s Github Repository

--

--

Jonah Apagu

A student of technology i am leveraging on the power of my imaginations given to me by God to add value to my world