$ docker compose build
$ docker compose up
npm i
- Create an AWS account if you don't have one.
- Create an IAM User
- Export
aws_access_key_id
andaws_secret_access_key
env variables. - Run
brew install awscli
in the terminal to install AWS CLI - Run
aws configure
to Authorize SST via AWS CLI - Run
npm run dev
to run the Go Lambda Gateway V2 server locally, proxied through Lambda to your local
- Add to your
.zshrc
/.bashrc
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
go install github.com/a-h/templ/cmd/templ@latest
- Run
templ generate
npm run dev
should finish with an AWS endpoint, hitting that endpoint should
show a list of events in that particular stage's dynamoDb table
curl <AWS URL from npm run dev>
- list table Events
curl -X POST -H 'Content-Type: application/json' -d '{"name": "Chess Tournament", "description": "Join the junior chess tournament to test your abilities", "datetime": "2024-03-13T15:07:00", "address": "15 Chess Street", "zip_code": "84322", "country": "USA"}' <AWS URL from npm run dev>
-
insert new event
https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dynamodb/index.html
If you see an error like
(!) templ version check failed: generator v0.2.513 is older than templ version v0.2.648 found in go.mod file, consider upgrading templ CLI
,
you need to update the templ
go binary
go install github.com/a-h/templ/cmd/templ@latest
When updating env vars, the changes need to be made in 4 places:
stacks/ApiStack.ts
.github/actions/set_aws_creds_env_vars/action.yml
(inputs
section).github/actions/set_aws_creds_env_vars/action.yml
(run
section where vars areecho
d).env.example
to clarify in version control what our currently-used env vars are