Giter Club home page Giter Club logo

xalts_assignment's Introduction

Prerequisites

  1. Docker installed in your system
  2. AWS account created
  3. Terraform installed in your system
  4. Access key and Secret key to create the infrastructure

Running in Local - Details

  1. Clone the repository in local
  2. Go inside the folder RESTAPI
  3. Build the docker file using the command
docker build -t my-rest-api .

It would look something like this

image

  1. Run the application using docker by this command
docker run -d -p 5000:5000 my-rest-api

It would look something like this

image

  1. Open the browser and hit the url It would look like this

image

Postman - Optional

If you hit the same URL using GET call in Postman app, it will show the following results.

image

Running the Terraform file

This Terraform configuration file provisions an AWS EC2 instance and runs a Dockerized REST API on it.

Prerequisites

  • Terraform installed on your machine
  • AWS CLI configured with access key and secret key

Usage

  1. Clone the repository:
git clone https://github.com/your-repo.git
cd xalts_assignment
  1. Initialize Terraform
terraform init
  1. Review and apply the Terraform configuration:
terraform plan
terraform apply
  1. Access your REST API:Once the Terraform apply is successful, you can access your REST API at
http://<ec2-public-ip>:5000
  1. Replace your_access_key_id and your_secret_access_key with your AWS access key ID and secret access key respectively. Adjust the region (us-west-2), AMI ID (ami-XXXXXXXXXXX), and any other parameters as needed for your setup.

Running in AWS - Details

Once you run the terraform script in local, this is how the result is going to look like

AWS Instance and Security Group

image

Live App from EC2 instance

image

xalts_assignment's People

Contributors

maeydhaw avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.