Install aws cli tool and configure with bytabit access key id, secret key, region 'us-east-1', default output 'json'.
$ brew install awscli
$ aws configure
Install terraform if not already installed.
$ brew install terraform
If this is the first time you've used terraform for this project, init project, select and refresh workspaces.
$ cd terraform
$ terraform init
$ terraform workspace select regtest
$ terraform refresh
$ terraform workspace select test
$ terraform refresh
Build and zip application jar and it's dependencies and store on aws S3. For now manually set version (eg. v0.4.0).
$ ./gradlew buildZip # to build the application jar
$ aws s3 cp build/distributions/bytabit-serverless.zip s3://bytabit-serverless/v0.4.0/bytabit-serverless.zip
In order to deploy the application APIs select the workspace (regtest or test) and apply the terraform config files.
REGTEST
$ cd terraform
$ terraform workspace select regtest
$ terraform apply -var="app_version=0.4.0" # manually set version, see above
TEST
$ cd terraform
$ terraform workspace select test
$ terraform apply -var="app_version=0.4.0" # manually set version, see above
$ curl get https://regtest.bytabit.net/version
$ curl get https://test.bytabit.net/version