🚀 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.


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.

Deployment
Terraform Cloud is utilized for deploying my infrastructure. I have two workspaces (access required to see these):
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_TWEETS=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