Background
Web previews are an Amplify feature that, on every pull request, auto-deploys the to-be-merged code in its own environment, and creates a URL to the candidate application so reviewers can see it in action. Quoting AWS's description from the link:
A web preview deploys every pull request made to your GitHub repository to a unique preview URL which is completely different from the URL your main site uses. For apps with backend environments provisioned using the Amplify CLI, every pull request (private Git repositories only) spins up an ephemeral backend that is deleted when the PR is closed.
Question
I want to extend the "Web Preview" idea of "fully isolated temporary environment for the new code" to include the database, say a Postgres or Mongo DB that the application uses.
So, on a new PR, we would deploy not only a backend for the candidate code, but also a temporary, fresh copy of our database, pre-filled with known dummy data. This would help enable consistent, non-flaky end-to-end tests.
- Does AWS provide a way to do this out of the box?
- If not, what approach could we use to achieve this? I assume would it be scriptable somehow, but where would I hook into the Amplify auto-deploy process?