qTweet is a dead simple AWS SQS to Twitter serverless speaker :speaker:.
Publish message :love_letter: to SQS (FIFO), Lambda function will handle publishing it to Twitter. Automagically. :tada:
To be honest, my plan is to automate the tweet of certain information using this queue in multiple side projects.
As usual, I’m sharing this with you folks as I was not able to find equivalent in Github / Open source projects. I hope it could be useful to someone else.
Full repository is available on Github
Getting started
Update variables in
Makefile
andtf/variables.tf
according to your environment.
- type
make
to get started (help)
Requirements
How to deploy on my AWS Account
make all
(all-in-one command)
Manual - Under the hood (for Plumbers)
make artifacts
(create S3 bucket)make tf-package
(create the artifact and push to S3)make tf-init
(to prepare terraform deployment)make tf-validate
(optional) validate the IaCmake tf-plan
(optional) Dry-Runmake tf-apply
Deploy the infrastructure
nb: Terraform is using remote state on S3.
Setup Twitter secrets
How to get Twitter API Keys: https://developer.twitter.com/en/docs/basics/apps/guides/the-app-management-dashboard
After you’ve deployed the Terraform you will need to set Twitter API Keys manually to AWS Secret Manager using AWS console.
Set the following credentials in AWS Secret Manager:
- Consumer Key
- Consumer Key Secret
- Access Token
- Access Token Secret
How to publish a message
Using AWS Console
Using AWSCLI
|
|
Doc: https://docs.aws.amazon.com/cli/latest/reference/sqs/send-message.html
Using Python (boto3)
|
|
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update the tests as appropriate. (just kidding, there is no test :|)
Credits
- AWS SQS
- AWS Lambda function
- AWS Secrets Manager
- Tweepy Python Library
That’s all folks!
zoph.