0

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?

Jay
  • 3,373
  • 6
  • 38
  • 55
  • Similar (year old and unanswered) question [here](https://stackoverflow.com/questions/72300802/unable-to-make-modifications-to-amplifyconfiguration-dart) – Jay Aug 21 '23 at 07:32

0 Answers0