bensonmacharia / book_store_api

A simple Go Microservice to illustrate API security logging with Logrus, persisting database data on AWS EFS and forwarding security logs to AWS CloudWatch with Fluent Bit dameon

Home Page:https://lnkd.in/d3qTv74h

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Go API on EKS Logging with Logrus and Fluent Bit on AWS CloudWatch

This repository illustrates a simple Go microservice that allows a user to register, login, add and query books from their library. The API makes use of JWT to control authorization for the Add-a-book and List-books endpoints. All data in PostgreSQL database is persisted in a PostgreSQL container. The Go Logrus library is used for structured logging to record API access and transactional activities.

Local Deployment

  1. Grab the repository
    $ git clone https://github.com/bensonmacharia/book_store_api.git
  2. Configure the environment variables
    $ cd book_store_api
    $ cp .env.example .env
    Make sure to edit the variables inside <<>> to set up your custom configuration.
  3. Run the application
    $ docker-compose up -d
    #Confirm the containers have been created and are running
    $ docker ps

Deployment on AWS

AWS Deployment

Follow this guide to deploy this application on AWS - https://lnkd.in/d3qTv74h

The guide will illustrate how to deploy the application on AWS EKS, persist the database in an AWS EFS and ship logs to AWS CloudWatch with the aid of the Fluent Bit daemon.

About

A simple Go Microservice to illustrate API security logging with Logrus, persisting database data on AWS EFS and forwarding security logs to AWS CloudWatch with Fluent Bit dameon

https://lnkd.in/d3qTv74h


Languages

Language:Go 91.0%Language:Dockerfile 5.9%Language:Shell 3.1%