A serverless SMS wrapper on Queue-Times, a public data source for theme park wait times.
- Install Terraform.
- Install Docker and start the Docker daemon.
- Configure a default AWS profile in
.aws/credentials. - Provision a phone number capable of SMS on Twilio.
- Create an S3 bucket for your Terraform state.
- Inside the
src/folder, runpython build.pyto build the Lambda artifacts. - Inside the
infra/folder, create aterraform.tfvarsand populate the below variables:
twilio_account_sid = ""
twilio_auth_token = ""
twilio_phone_number = ""
- Update the Terraform backend in
config.tfto point to your Terraform state bucket on S3. - Run
terraform workspace new devto create a development workspace. - Run
terraform init, thenterraform apply. Typeyeswhen prompted. - Copy the output
twilio_webhook_target_urland paste it as theA MESSAGE COMES INwebhook target of your phone number in the Twilio console. Set the method toHTTP POST. - Send a text to your Twilio phone number. For example:
Cedar Point
Steel Vengeance
30
The variable upstream_env_name in terraform.tfvars allows lower environments to optionally plug into data from upper environments.
This is to reduce your impact on the upstream data source Queue-Times; it also reduces the number of Lambda functions executing concurrently in your AWS account.
To create separate production and development environments consuming the same data:
- Follow the Quickstart guide for a workspace named
prod. - Follow the Quickstart guide again for a workspace named
dev. When setting variables interraform.tfvars, change the Twilio phone number to a new number for the new environment. Also add the below variable:
upstream_env_name = "prod"
After completing the Quickstart guide the second time, dev will be consuming from SNS topic notifcation_topic_prod and pointing to S3 bucket wait-time-bucket-prod, but using its own Lambda functions, Dynamo table, Twilio phone number, etc.
This allows you to reuse the data from prod while safely developing new SMS features in an isolated dev environment.