Giter Site home page Giter Site logo

inovex / go-aws-meetup-example Goto Github PK

View Code? Open in Web Editor NEW
1.0 5.0 0.0 29 KB

Minimalistic Go example service to be deployed as a lambda function on AWS. Showcases some best practices we adapted in a project over a few months.

License: MIT License

Makefile 1.99% Go 58.90% HCL 35.33% Shell 3.78%

go-aws-meetup-example's Introduction

Go AWS Meetup Example

Minimalistic example service to be deployed as a lambda function on AWS. It's intended to show the best practices we explained during our meetup "Building an MVP with serverless Go".

How to use this

This is just a simple demo service that reads and writes some items to DynamoDB. It is only used for education purposes and doesn't provide any real value apart from that. If you want to use this as a way to get started with Go and AWS, feel free to dig through the source and learn from our experience.

Build and Run

To build and run the software locally, you can use make.

make build

This will generate an executable file called main in the project directory. You can put .aws.access and .aws.secret files in the working directory, containing the access key and secret access key of a set of user credentials, respectively. The example service will use those to authenticate with AWS when you run the service locally.

To get more information, run

./main -h

The service assumes AWS resources (specifically DynamoDB tables) to be present and accessible via the provided credentials.

Deploy

Deployments are handled by terraform. To get started, look in the terraform/ directory. There is a terraform wrapper script called terraformw.sh which simplifies some things during initialization and for everyday use. Mainly, it will set the stage variable to the first positional argument given:

./terraformw.sh dev apply

will effectively run

terraform -var="stage=dev" apply

To get started in your own AWS account, you need:

  • a set of credentials with administrator access to your account (create/modify/delete resources) configured to use with the AWS cli...
  • S3 buckets called go-meetup-tf-state-<stage> in the eu-central-1 region...
  • DynamoDB tables called tf-state-lock-<stage> in the eu-central-1 region...

where <stage> is equal to dev, int or prd. If you want to deploy in another region, make some changes in main.tf and main.go.

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.