I am currently working on an environment that gets destroyed every night and redeployed every morning. The CDK provides a construct named DatabaseInstanceFromSnapshot but this won't create one if there is no snapshot available.
Is there a way to check for "If a snapshot is available, use DatabaseInstanceFromSnapshot
, else use DatabaseInstance
"? I tried with SSM parameters but these don't get fetched until during the Cloudformation deployment (when the if/else is already parsed so the value doesn't matter of the SSM parameter)