Book Image

Hands-On Serverless Applications with Go

By : Mohamed Labouardy
Book Image

Hands-On Serverless Applications with Go

By: Mohamed Labouardy

Overview of this book

Serverless architecture is popular in the tech community due to AWS Lambda. Go is simple to learn, straightforward to work with, and easy to read for other developers; and now it's been heralded as a supported language for AWS Lambda. This book is your optimal guide to designing a Go serverless application and deploying it to Lambda. This book starts with a quick introduction to the world of serverless architecture and its benefits, and then delves into AWS Lambda using practical examples. You'll then learn how to design and build a production-ready application in Go using AWS serverless services with zero upfront infrastructure investment. The book will help you learn how to scale up serverless applications and handle distributed serverless systems in production. You will also learn how to log and test your application. Along the way, you'll also discover how to set up a CI/CD pipeline to automate the deployment process of your Lambda functions. Moreover, you'll learn how to troubleshoot and monitor your apps in near real-time with services such as AWS CloudWatch and X-ray. This book will also teach you how to secure the access with AWS Cognito. By the end of this book, you will have mastered designing, building, and deploying a Go serverless application.
Table of Contents (17 chapters)

API documentation

Before finishing this chapter, we will go through how to create documentation for the serverless API we've built so far.

On the API Gateway console, select the deployment stage that you're interested in generating documentation for. In the following example, I chose the production environment. Then, click on the Export tab and click on the Export as Swagger section:

Swagger is an implementation of the OpenAPI, which is a standard defined by the Linux Foundation on how to describe and define APIs. This definition is called the OpenAPI specification document.

You can save the document in either a JSON or YAML file. Then, navigate to https://editor.swagger.io/ and paste the content on the website editor, it will be compiled and an HTML page will be generated as follows:

The AWS CLI can also be used to export the API Gateway documentation with the aws...