Install GoLang v1.10+
Install dep - go dependency management tool Build lambda-build-zip - used to create zip archives
Install dep
export DEP_RELEASE_TAG=v0.5.0
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | shInstall lambda-build-zip
After installation lambda-build-zip should be accessible from command promopt.
If that's not the case, you might want to check if lambda-build-zip is in $PATH (echo $PATH).
As a last resort, copy lambda-build-zip from $GOPATH/bin to /usr/local/bin.
AWS SAM has issues with AWS CLI versions >1.16.145~
virtualenv -p python3.7 cli_env
source cli_env/bin/activate
pip install awscli==1.16.141
pip install --user aws-sam-climake vendor - get dependencies with dep
make LAMBDA_NAME - build LAMBDA_NAME lambda into the /bin dir. Example:
make registerHow to debug on your local machine?
Go to project root, and type:
ENV=local go run ./functions/[SPECIFIC_FUNCTION]/*.goSPECIFIC_FUNCTION is one of the packages in functions directory.
Example:
ENV=local go run ./functions/signup/*.go Place .env file into the project root dir.
Required environment variables:
COGNITO_REGION=us-east-1
COGNITO_USER_POOL_ID=us-east-xxxxxxxxxxx
COGNITO_CLIENT_ID=xxxxxxxxxxxxxxxxxxxxxxxxxxIf you are running app in local environment, you need:
AWS_ACCESS_KEY_ID=xxxxxxxxxxxxxxxxxxxx
AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx- go - Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.