Search code examples
amazon-web-servicesaws-amplifyaws-amplify-cli

What happens if I edit aws-exports.js?


Despite the way AWS Amplify currently works, some tools (e.g. EAS) require aws-exports.js to be included in a project's repo. However in order to safely do this, aws-exports.js needs to be edited locally so that sensitive information there is replaced with environment variables.

My question is, what happens if I do that? If I edit aws-exports.js and replace values there with environment variables

  1. will any of my edits get overwritten by my use of the Amplify CLI (e.g., push or pull or add or update)?
  2. Will any of my edits end up affecting the configuration of the backend?

Solution

  • aws-exports.js is simply representation of your backend (so that the frontend can access to the backend).

    If you edit it, it won't affect any of the backend configuration, and will be re-generated on backend changes.


    It's true that Amplify CLI still lacks some features. For example: setting API GateWay authorization type to API KEY. To do that, you need to use amplify override api and it will generate file next to your API in /amplify/backend/api/... directory where you can override default configs.