boca-chica-bot

module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 1, 2021 License: MIT

README

🚀 boca-chica-bot

I am a Twitter Bot that tweets status updates to beach and road closures related to SpaceX Starship testing in Boca Chica, TX.

twitter-badge
Add me to your Discord Server

go-version-badge go-report-card-badge pkg-go-dev-badge

How I Work

I periodically pull the published road and beach closures from the Cameron County SpaceX page to see if there are any changes or additions, then tweet them out as @BocaChicaBot.

I'm written in Go and run serverless in AWS using AWS Lambda, DynamoDB, and EventBridge.

arch diagram


Deployment

Terraform Cloud is utilized for deploying my infrastructure. I have two workspaces (access required to see these):

Terraform Cloud Workspace Setup

Required Environment Variables for these workspaces in Terraform Cloud:

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • TF_CLI_ARGS_plan=-var-file=workspaces/test.tfvars (for test)
  • TF_CLI_ARGS_plan=-var-file=workspaces/prod.tfvars (for prod)

Required Terraform Variables in Terraform Cloud:

  • twitter_consumer_key
  • twitter_consumer_secret
  • twitter_access_secret
  • twitter_access_token

These are used to populate the Parameter Store with the required Twitter API creds.

Local Development

Create a .env file with these env vars set:

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=us-east-1
DEBUG=true
DISABLE_PUBLISH=true
TWITTER_ENVIRONMENT=test

The .env file is leveraged in the lambci/lambda:go1.x Docker container used to run the lambda handler locally:

make run

Reference

Directories

Path Synopsis
cmd
internal
db
pkg
closures
Package closures retrieves beach and road closures related to SpaceX Starship testing in Boca Chica, TX.
Package closures retrieves beach and road closures related to SpaceX Starship testing in Boca Chica, TX.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL