Code Monkey home page Code Monkey logo

elastic-beanstalk-go-demo's Introduction

AWS Elastic Beanstalk Go Demo

Video demo: https://markrichman.com/2017/02/17/aws-elastic-beanstalk-go/

Creating a source bundle

Create a zip file from the root of this package, for example:

cd $GOPATH/src/github.com/mrichman/elastic-beanstalk-go-demo

Then, either zip it from the command line:

zip ../eb.zip -r * .[^.]*

or use git:

git archive -o ../eb.zip HEAD

The git command above will zip up the last commit on master.

Deploying a Go Application on Elastic Beanstalk

Browse to the Elastic Beanstalk console, and click "Create New Application".

Give it a name, for example "Go Demo". Then create a new web server environment. For "Platform", select "Go", then select "Upload your code".

For simple Go applications, there are two ways to deploy your application:

  • Method 1: Provide a source bundle with a source file at the root called application.go that contains the main package for your application. Elastic Beanstalk automatically builds the binary using the following command at deployment time:

    go build -o bin/application application.go

  • Method 2: Provide a source bundle with a binary file called application. The binary file can be located either at the root of the source bundle or in the bin/ directory of the source bundle. If you place the application binary file in both locations, Elastic Beanstalk uses the file in the bin/ directory.

By default, Elastic Beanstalk configures the nginx proxy to forward requests to your application on port 5000. You can override the default port by setting the PORT system property to the port on which your main application listens.

For "Source code origin", choose "Local file" and pick the eb.zip file created above. Enter anything for "Version label".

Click "Upload", then back at the "Create a new environment" screen, click "Create environment".

Your application will begin to deploy. This process can take several minutes.

When the deployment is complete, you'll be redirected to your Elastic Beanstalk application's overview page. In the breadcrumb trail at the top, next to your Environment ID, you'll see a URL in the control panel ending in elasticbeanstalk.com where you can browse your application.

To clean up after yourself, and terminate your application, click the Actions menu and select "Terminate Environment". This will terminate any EC2 instances created during deployment. You can restart your application by selecting Actions -> Create Environment again.

elastic-beanstalk-go-demo's People

Contributors

mrichman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.