I'm using Amplify for auth but have my own existing REST API.
I also have different deployments of this API for my different environments local
, dev
, production
etc.
The amplify docs say that to do so one needs to modify the amplifyconfiguration.json
file.
E.g.
{
"api": {
"plugins": {
"awsAPIPlugin": {
"[API NAME]": {
"endpointType": "REST",
"endpoint": "[API GATEWAY ENDPOINT]",
"region": "[REGION]",
"authorizationType": "[AUTHORIZATION TYPE]",
...
}
}
}
}
}
Note: I haven't found any mention of this file other than in the docs so I assume they mean the lib/amplifyconfiguration.dart
(which contains the configuration as a json string).
The existing api I wish to add has a different url for each amplify environment.
And when switching between environments amplify appears to rebuild the amplifyconfiguration.dart
file.
So my question is:
Does anyone know how you can configure an existing resource per environment and have it update in the lib/amplifyconfiguration.dart
as one switches environment with amplify env checkout dev|prod|etc
?