AWS: Creating APIs Using Go Part1

Written by harrison_brock | Published 2019/01/12
Tech Story Tags: aws-api | aws-lambda | dynamodb | aws | software-development

TLDRvia the TL;DR App

AWS: Creating APIs Using Go Part 1

AWS AndDymanoDB Setup

Over the next few months, I will be writing about how to use AWS and Go to create web applications. For this first post, I’m going to be writing about how to develop microservices using Go, AWS Lambda Functions, the AWS API Gateway, and DymanoDB.

What Are We Going To Build?

We are going to be building a simple contact/address book application. This will allow the end-user to create a new contact, view contacts, search for contacts, edit contacts, and delete contacts.

But in this first post, we will only be setting up AWS account and creating our database.

Signing Up For AWS Free-Tier Account

I’m not going to walk you through how to signup for an AWS because this is a well-documented process. You can use this link to set up your account.

Setup AWS CLI

Before installing AWS you should create a new account for yourself and download your security credentials.

You can find information here about how to install AWS CLI on your platform here.

Create The Contacts Table

We will be using DymanoDB for our database. To create a new table login the AWS console and search for DymanoDB from the list of services.

After selecting DyanamoDB click, the create table button. This will bring up a page to create a new table. Enter a table name of contacts and enter the name ID for the Partition key and select String from the dropdown list of datatypes.

After this click the create button.

Add Items To The Database

To create a new item select the new Items and click the create item button.

For our contact item, we want an id, name, phone, email company and title values. Enter values like in the image below and click the save button.

You should create a few more test records using the steps above.

Conclusion

In this first post, we cover how to set up AWS and how to create a DymanoDB table to hold our contacts. In the upcoming posts, I will cover how to create functions to add, get, and remove data from the database.

Originally published at harrisonbrock.com


Published by HackerNoon on 2019/01/12