- Newest
- Most votes
- Most comments
Hello, I would like to share a few updates for the above response:
This zero-configuration approach means all your backend resources (including your FastAPI service and database) would be defined as code and deployed as part of the preview environment. Since Amplify Gen 2 is built on top of AWS CDK, you can extend and customize any AWS service by authoring CDK code inline in your project.
For your specific setup, you could:
- Define your FastAPI service to run on Fargate as part of your Amplify backend code
- Configure Aurora Serverless v2 PostgreSQL to be provisioned with your snapshot data: -> You can refer to the below documentation to create a Read Replica from CDK
[+] DatabaseInstanceReadReplica
- Set up your Playwright E2E tests to run against the preview URL: -> Please note that currently, Amplify only supports E2E tests with the Cypress testing framework as E2E tests support with Playwright. However, you can surely use any other third party that supports E2E tests Playwright framework.
[+] Cypress tests for your Amplify application
[+] Github issue for Supporting Playwright testing framework with Amplify
If you'd like, please feel free to add a +1 so that we can track the number of requests
Regards,
AWS Amplify's fullstack previews feature seems perfectly aligned with what you're trying to achieve. With Amplify Gen 2, you can set up ephemeral fullstack environments on every pull request, allowing you to test features in isolation from production.
The workflow would look like this:
- Your main branch (production) and feature branches are deployed on Amplify
- When a pull request is opened, a fullstack preview environment is automatically deployed
- This preview is accessible at a unique URL (e.g., pr-1.appid.amplifyapp.com)
- Once the PR is merged, the environment is automatically torn down
This zero-configuration approach means all your backend resources (including your FastAPI service and database) would be defined as code and deployed as part of the preview environment. Since Amplify Gen 2 is built on top of AWS CDK, you can extend and customize any AWS service by authoring CDK code inline in your project.
For your specific setup, you could:
- Define your FastAPI service to run on Fargate as part of your Amplify backend code
- Configure Aurora Serverless v2 PostgreSQL to be provisioned with your snapshot data
- Set up your Playwright E2E tests to run against the preview URL
The advantage of this approach is that Git becomes the source of truth for your entire stack, making environments reproducible and portable across branches. This simplifies promotion workflows from lower to upper environments and allows team members to test changes with confidence before merging to production.
One thing to consider: if you want to save resources, you could configure your preview branches to share backend resources from your dev branch instead of creating completely isolated environments for each PR. This would be a trade-off between full isolation and resource efficiency.
Sources
Fullstack previews - AWS Amplify Gen 2 Documentation
AWS Amplify - Code First Development
Concepts - AWS Amplify Gen 2 Documentation
Deploy React and Server Side Rendered Apps and Static Sites - Amplify Hosting - AWS
Relevant content
- asked 3 years ago
- asked 2 years ago
- AWS OFFICIALUpdated a year ago
