Skip to content

A serverless SMS wrapper on Queue-Times, a public data source for theme park wait times.

License

Notifications You must be signed in to change notification settings

caseyjohnsonwv/chaindog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chaindog

A serverless SMS wrapper on Queue-Times, a public data source for theme park wait times.


Prerequisites

  1. Install Terraform.
  2. Install Docker and start the Docker daemon.
  3. Configure a default AWS profile in .aws/credentials.
  4. Provision a phone number capable of SMS on Twilio.
  5. Create an S3 bucket for your Terraform state.

Quickstart

  1. Inside the src/ folder, run python build.py to build the Lambda artifacts.
  2. Inside the infra/ folder, create a terraform.tfvars and populate the below variables:
twilio_account_sid  = ""
twilio_auth_token   = ""
twilio_phone_number = ""
  1. Update the Terraform backend in config.tf to point to your Terraform state bucket on S3.
  2. Run terraform workspace new dev to create a development workspace.
  3. Run terraform init, then terraform apply. Type yes when prompted.
  4. Copy the output twilio_webhook_target_url and paste it as the A MESSAGE COMES IN webhook target of your phone number in the Twilio console. Set the method to HTTP POST.
  5. Send a text to your Twilio phone number. For example:
Cedar Point
Steel Vengeance
30

Managing Multiple Environments

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:

  1. Follow the Quickstart guide for a workspace named prod.
  2. Follow the Quickstart guide again for a workspace named dev. When setting variables in terraform.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.

About

A serverless SMS wrapper on Queue-Times, a public data source for theme park wait times.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published