Skip to content

coldbrewcloud/tutorial-echo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tutorial: Running a Go application on AWS using coldbrew-cli

This is a sample project to demonstrate how to run a Go applicaiton on AWS using coldbrew-cli. The sample application in this tutorial is simply return the HTTP request body data in the HTTP response.

0. Prerequisites

Docker

Install Docker in your system. Make sure you can run docker from your command line.

coldbrew-cli

Install coldbrew-cli.

AWS Account Keys

You will need AWS access keys to configure coldbrew-cli. Either set the environment variables or use CLI Global Flags.

1. Clone This Repo

git clone https://github.com/coldbrewcloud/tutorial-echo.git
cd tutorial-echo

This project contains

*Compiled binary echo is included, but, if you want,, you can modify its source main.go and recompile it by running make build.

3. Create a Cluster

Before you can deploy the application, you need to create your first cluster. You can create the cluster using cluster-create command.

coldbrew cluster-create tutorial --disable-keypair

*In this tutorial, --disable-keypair flag was used to skip assigning EC2 key pairs to ECS Container Instances, but, that's not recommended if you need to access the instances directly (e.g. via SSH).

*It will take a couple of minutes until all EC2 Instances (ECS Container Instances) finish initialization and register to ECS Cluster. But you can proceed to deploy your app.

4. Deploy App

Now you use deploy command to build the Docker container image and deploy it to AWS ECS.

coldbrew deploy

Now you just need to wait a couple more minutes (or even less if it's not the first deploy) until all AWS resources get fully configured.

5. Check the Status

Use status command to see the current running status of your app.

coldbrew status

6. Clean Up

You can delete all resources for the app and cluster using deploy and cluster-delete respectively.

coldbrew delete

coldbrew cluster-delete tutorial

About

Tutorial: Running a Go application on AWS using coldbrew-cli

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published