I’ve recently started using Aurora Serverless and I have everything up and running in terms of infrastructure, but I’m having some issues when it comes to actually setting up the database itself.
So, when my stack finishes deploying I have a lambda function that runs immediately the sole responsibility of which is to set up the database tables.
I have a sql file that defines the table creation queries which as it stands, I am bundling with my lambda reading it from disk, splitting the file at
; to separate each query then using the Data API to run them in sequence.
This works and I suppose does the job, but it feels wrong. MySQL has import / export functionality, is there anyway you can define the schema of the database at creation, or run a sql file without having to manually separate the queries and manage their execution?
Thanks for any help!