Hi,
I started a web-app, with the backend first, using the CDK. I set-up a pipeline following best-practices, that is:
- dev account: deploy backend to own account;
- gamma account: deploy backend to a gamma specific account;
- prod account: deploy backend to a prod specific account;
- pipeline is actually in gamma account, and deploy the CDK to gamma, then to prod
Then I started working on the frontend with Amplify. I did not realized that Amplify could generated backend as well. My bad. But anyway, I was able to have amplify set-up in the prod account, that is connected to a prod backend environment (that only contains the auth imported Cognito pooled that is created by the CDK backend in the Prod account).
For deployment purpose, I would like the following:
- developers checkout the frontend code, specifies to amplify the backend should be the one generated by the CDK in their own dev account, so they can test in full;
- when developer commit and push to gitlab (could be in a gamma git branch), some integration tests are run in gamma account (that means some setup are done for the frontend/amplify to use the CDK generated gamma backend).
- at some point, the frontend code is merged (automatically or manually) to git/main, and flows such that amplify deploy this frontend connected to the CDK generated prod backend.
The backend continues to live on its own, and is deployed according to commit/push made on the backend branch, with the CDK pipeline deploying to the different accounts accordingly.
I'm not sure how to tune Amplify for such a thing.
How to tell amplify, at least locally, that the backend to use is the one from another AWS account (the dev one for now)?