Repository for a Golang HTTP JSON API running on AWS lambda and configured via Terraform.
- Install the AWS CLI.
- Create an IAM role with adequate permissions in AWS.
- Run the
aws configure
command. - Run
export AWS_PROFILE=your_configured_user
to source the identity into the shell. - Install the Terraform CLI.
- Run
terraform init
in the root directory to download the providers.
- Run
make
to build the binary. - Change into the infrastructure folder:
cd infrastructure
- Run
terraform apply
to apply the changes and upload the binary. Confirm. - POST to the endpoint:
curl -X POST https://mq4s9j0l8b.execute-api.us-east-2.amazonaws.com/test/hello -d '{ "name": "Harry" }'
- Rip down the infrastructure (still in the infrastructure folder):
terraform destroy
- Run
. bin/deploy
from the root repo (make sure to run within the existing shell with.
orsource
) - curl -X POST "$TF_URL/hello" -d '{ "name": "Harry" }'