Best way to provision/populate resources for continuous deployment?

Hi all,
My problem is this: I have a lambda service that relies on a prepopulated databse (DynamoDB, for sake of argument). The first time it’s deployed to a given stage (dev, test, prod), it needs to create and populate this database. Every time there after it just needs to use the database. The problem is if I put the DB in the resources section of my serverless.yaml, CloudFormation will overwrite it every time, right?

What is the best way to structure this in my project?

Currently: I’ve have two separate projects: “project” and “project-deploy”. project-deploy contains all the cloudformation stuff, populates the DB, and is ideally only run once or during infrastructure changes (via a lambda function ‘initialize’). project then does not have a resource section at all and is run under the assumption that everything is already created.

Is this a reasonable approach?

Thanks,
Alex