The final disclaimer
I know I’ve said it about a dozen times before, but here it is for the last time: This tutorial was built to teach you cool AWS services and give you some practical experience with them. There are many, many different ways that you could have done this, and not all of them are equally suited for all purposes. Still, this very closely resembles actual production code that I have used in a company (with their explicit permission to write this guide, of course). It works, and it’s battle-tested.
Let’s Send Some Tweets With Lambda
Okay, so now is finally the point where this Twitter thing comes together. In this section, we’ll process the user’s authorization to have them follow us, as well as send them a tweet stating that they are successfully signed up!
How to make a session in DynamoDB
In this section, we’re just going to save some browsing information in a session (held in DynamoDB) and redirect the user to Twitter. Once we have a callback in place, we’ll use that session data to have our user follow us. We can also use that data to message that user later (we actually have the user DM themselves, explained in the next section) with some promotional news.