This application reads environment variable SECRET_MESSAGE and sets up an API endpoint /secret that will return the secret message.
It also has an /health endpoint for Infra services to verify if the app is healthy.
The source code is in *.go files while the infrastructure is setup in terraform directory. Make sure to read the README.md
under that directory to correctly run the commands in the right order.
Prerequisites
Go (> 1.11)
Docker
Configuration
Set these environment variables
PORT -> the port the http server will be exposed on (default 8080)
SECRET_MESSAGE -> the env var where the secret is stored
DB_USERNAME -> username for the SQL server
DB_PASSWORD -> password for the above user
DB_URL -> endpoint for SQL server
Future Work
Increase test coverage: Test sql connection function
Setup versioning for docker images
Create automated build and push docker image pipeline
Add downstream dependencies health check under /health api
Force SSL for AWS Beanstalk LB
Setup encryption and locking for terraform state files