This is a lambda function to check a twitter users timeline and post any new tweets to a discord webhook.
- Docker is used to build and package the function
- Terraform is used to provision the infrastructure for this serverless function.
- git clone the repo
- create
tf\secrets.auto.tfvars
from the example - add your api keys and discord webhook
- run
build.sh
- builds and packages the function - run
terraform plan
thenterraform apply
intf
It should now be installed, however you need to add entires for each user you want to follow into the dynamodb table. e.g.
{
"screen_name": { S: 'OpenAI' },
"since_id": { S: '867411728857939970' },
"exclude_replies": { BOOL: true }
}
If you make changes to the app then run steps 4 & 5 again.
Terraform provisions the following:
- IAM role
- IAM policy
- Lambda function
- Cloudwatch event
- Dynamodb table
- Cloudwatch log group
enjoy!