- Deployment to AWS as a standalone server
- Deployment to AWS as Lambda Functions + API Gateway
- To remove a Terraform deployment
This repo contains a basic deployment setup striving for the cheapest possible server hosted application on AWS.
With Rust, the resource usage is so low that it can run at high throughput on the smallest & cheapest ec2 instance (t4g.nano) with plenty of headroom.
- awscli v2 installed
- terraform installed
- docker installed & running
- Create a
./secrets
directory (this whole directory and sub files are already added to.gitignore
) - Create a
./secrets/slack_secret
file that only contains your slack signing secret - Create a
./secrets/slack_token
file that only contains your slack bot token (starts withxoxb-
) - Create a
./secrets/pagerduty_token
file that only contains your pagerduty api token (if you don't have one, you will need to comment out some lines in Terraform OR just put a fake token here)
cd terraform_aws/remote-state
terraform init -backend-config="../config/config.s3.tfbackend"
terraform plan
, thenterraform apply
and approve
Docker must be running and aws cli (v2) must be installed!
cd terraform_aws/server
terraform init -backend-config="../config/config.s3.tfbackend"
terraform plan
, thenterraform apply
and approve
If you prefer serverless, we can instead run the app as 3 lambda functions behind API Gateway
With Rust you get the fastest cold starts possible so there is no risk of Slack Trigger IDs timing out.
- terraform installed
- docker installed & running
- Create a
./secrets
directory (this whole directory and sub files are already added to.gitignore
) - Create a
./secrets/slack_secret
file that only contains your slack signing secret - Create a
./secrets/slack_token
file that only contains your slack bot token (starts withxoxb-
) - Create a
./secrets/pagerduty_token
file that only contains your pagerduty api token (if you don't have one, you will need to comment out some lines in Terraform OR just put a fake token here)
rustup target add aarch64-unknown-linux-musl
- (if on MacOS, you will need
musl-gcc
)brew install filosottile/musl-cross/musl-cross
- Ensure docker is running
docker -v
cargo xtask build-lambda-all
- This will build lambda packages in release mode inside a docker image, copy the binaries to the terraform directory, then rename the binaries to
bootstrap
which is required for AWS Lambdas using a custom runtime
- This will build lambda packages in release mode inside a docker image, copy the binaries to the terraform directory, then rename the binaries to
cd terraform_aws/remote-state
terraform init -backend-config="../config/config.s3.tfbackend"
terraform plan
, thenterraform apply
and approve
cd terraform_aws/serverless
terraform init -backend-config="../config/config.s3.tfbackend"
terraform plan
, thenterraform apply
and approve
- change directory to the terraform deployment you want to remove (remove the
remote-state
deployment last!)cd terraform_aws/<serverless|server|remote-state>
terraform apply -destroy
The Receptionist bot's Slack configuration is in a single ./manifest.yml
file can be pasted into your Slack App Manifest (either when creating a new app or modifying an existing one). You will just need to replace all instances of <MY_BOT_URL_HERE>
in the manifest.yml
with the actual URL of your deployed (or local) application.
The app ships with a slash command /rec-manage
that will display a UI for Creating, Editing, and Deleting Receptionist Workflow Responses