GithubHelp home page GithubHelp logo

go-cloudformation's Introduction

GoWebServer

Deploy web infrastracture for a hello world go app in AWS

How To Use

Cloudformation

To build infra, first we have to set the environment variables needed to run the scripts

export VPC_ID=
export CLUSTER_NAME=
export STACK_NAME=

Next we’ll make use of the helper scripts to run the cloudformation script

Scripts

./scripts/create-stack

Creates the cloudformation stack

./scripts/update-stack

Updates the cloudformation stack

./scripts/cleanup

Deletes the stack

Run the create stack script

./scripts/create-task

Github Actions

Once cloud formation has completed. We can now have access to the Role ARN on the outputs. Define GHA_ROLE_ARN on actions secrets or change this line on main.yml

role-to-assume: <your-arn>

Now that arn is set we can trigger the build pushing a commit

touch sample.txt
git commit -am "sample"

Update the Stack

Once the workflow is done without failures.

We need to update the service DesiredCount to a value greater than 0

ECSService:
  Properties:
    ...
    DesiredCount: 1

then update the stack

./scripts/update-stack

Access the app

On update stack complete, go to outputs tab and copy the loadbalancer dns name.

Cleanup

Run the ./scripts/cleanup

if cleanup fails delete the repository on aws console and run the script again

go-cloudformation's People

Contributors

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