Skip to content

zfz7/tetris_aws_go

Repository files navigation

tetris_aws_go

Goals

The goal of this project was to create a full stack AWS native project template. The secondary goal is to keep the DTO types in sync between the frontend and backend using code generation. Here is the achieved stack:

Warnings

smithy-go Does not yet work. Track this issue to see updated status

The go and typescript type generation rely on smithy-go and smithy-typescript, both products are not yet GA. As such they still have some quirks to work through. Overall it seems that the typescript code generation tool is a bit more stable.

If you stumbled across this guide another resource that wasn't GA but looks promising is: aws-prototyping-sdk, specifically the type-safe-api.

^last updated 11/05/2023

Getting started

Prerequisites

This project assumes the following are installed on your system:

Setup

  1. Clone the repo: git clone git@github.com:zfz7/tetris_aws.git
  2. Export the following variables:
export AWS_PROFILE=AdministratorAccess-123456789012
export AWS_ACCOUNT=123456789012
export ROOT_HOSTED_ZONE_ID_GO=ABCDEFGHIJKLIMOP
export ROOT_HOSTED_ZONE_NAME_GO=example.com
  1. Build the project (from root): ./gradle build
  2. Login to AWS: aws sso login
  3. Deploy the project (from root): ./gradle deploy

Other Commands

###Clean 
./gradlew clean #clean all projects
./gradlew <project>:clean 
./gradlew backend:clean 
###Build 
./gradlew build #build all projects
./gradlew <project>:clean 
./gradlew model:build
###Deploy 
./gradlew deploy

###Testing the endpoint with Cognito
export C_TOKEN="$(aws cognito-idp initiate-auth --region us-west-2 --auth-flow USER_PASSWORD_AUTH --client-id <YOUR_CLIENT_ID> --auth-parameters USERNAME=<USERNAME>,PASSWORD=<PASSWORD> | jq -r .AuthenticationResult.IdToken)"'
curl -H "Authorization: Bearer $C_TOKEN" https://api.daniel-eichman.com/hello\?name\=hi

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published