Code Monkey home page Code Monkey logo

elastic-beanstalk-docker-application-with-terraform's Introduction

ELASTIC BEANSTALK DOCKER APPLICATION WITH TERRAFORM

This guide outlines the steps to deploy a simple Todo List application to AWS Elastic Beanstalk using Terraform and Docker.

Configuration Files

  • Dockerfile: Defines the configuration for building the Docker image.
  • Dockerrun.aws.json: Specifies the Docker container configuration for Elastic Beanstalk.
  • provider.tf: Terraform configuration file for provider configuration.
  • iam.tf: Terraform configuration file containing iam roles and policy definitions.
  • ecr.tf: Terraform configuration file for containing elastic container registry to storing the docker images as well as automated resource for pushing docker image to the ecr.
  • main.tf: Terraform configuration file for creating AWS resources(elastic beanstalk and other related resources).
  • output.tf: Terraform output file for defining the outputs of the deployment.
  • /todo-list: Directory containing the source code for the todo list application. origanlly pulled from https://github.com/bradtraversy/50projects50days/tree/master/todo-list

Todos app Features

  • Add new tasks
  • Mark tasks as completed
  • Delete tasks

Prerequisites

Before deploying the application, ensure you have the following prerequisites installed:

  • Terraform
  • Docker
  • AWS CLI configured with appropriate credentials

Deployement

  1. Clone the Repository:

  2. updating dokcerrun.aws.json with your credentials Open the Dockerrun.aws.json file in your project directory and update the <Name> fields with your AWS account ID, region, repository name, and version. The format should be:

    "Name": "<ACCOUNT_ID>.dkr.ecr.<REGION>.amazonaws.com/<NAME>:<VERSION>"
  3. Deploy Infrastructure with Terraform:

    Initialize Terraform and apply the configuration to deploy the Todo List application on AWS Elastic Beanstalk.

    terraform init
    terraform apply --auto-approve
  4. Access the Application:

    Once the deployment is complete, you can access the Todo List application in your browser using the outputed URL from the terminal .

Clean Up (Optional)

If you want to tear down the infrastructure, you can destroy it using Terraform:

```bash
terraform destroy --auto-approve
``` 

A S3 bucket will be created by the elastic beanstalk by the name "elasticbeanstalk--" which is not automatically deleted to prevent accidental deletion of the bucket as it contain important config for the elastic beanstalk to delete that refer to https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/AWSHowTo.S3.html

Also remove the docker images from your local system

```bash
docker images //to view the current running images
docker rmi <image-id>
```

elastic-beanstalk-docker-application-with-terraform's People

Contributors

dhruvnotfound avatar

Stargazers

VEDANT GUPTA 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.