Initialization of RDS Schema

So, I’m working on this small application: It basically goes through all IPs (v4), sends an HTTP request to a pre-specified path and optionally compares the response with a provided regular expression. Useful if you want to scan the whole internet in search for for instance files like index.php.backup (because there are many fuck ups like that).

Now, it would be cool if I could cache the results from my search in a database. I already started working on the problem in a separate branch:

The issue is that I’m not sure what would be the proper way to initialize my database. It looks like CloudFormation doesn’t have what it takes to generate the database schema. Schema migrations done by lambda do not sound like the right way to go taken into account that a single request can trigger up to 250k lambda executions and only the first one would have to update the schema. I don’t want to expose my database to the world because other people like me would try to exploit it. Is there any easy way to automate the database schema generation then? In the perfect world, as soon as I type serverless deploy from my command line, the database should be ready to go…