5

amplify auto-ignores aws-exports.js in .gitignore possibly simply because it may change frequently and is fully generated - however maybe there are also security concerns?

For this project my github project is private so that is not a concern, but I am wondering for future projects that could be public.

The reason I ask is because if I want to run my app setup/build/test through github workflows then I need this file for the build to complete properly on github machines?

Also I appear to need it for my amplify CI hosting to work on amplify console (I have connected my amplify console build->deploy to my github master branch and it all works perfectly but only when aws-exports.js is in source control).

Here is my amplify.yml, I am using reason-react with nextjs, and my amplify console is telling me I have connected to the correct backend:

version: 1
frontend:
  phases:
    preBuild:
      commands:
        - yarn install
    build:
      commands:
        - yarn run build
  artifacts:
    baseDirectory: out
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*
AlBlue
  • 23,254
  • 14
  • 71
  • 91
wyn
  • 51
  • 2
  • The aws-exports is generated when you pull/checkout an environment, no need to version it – dfranca Jun 25 '20 at 09:01
  • @danielfranca thanks, I'm asking about what to do in environments where you cannot do (or it is difficult to do) amplify pull, e.g. github-workflows? To clarify further it is much easier to source control the aws-exports and push to github and then have the workflow run as expected than to set up the github workflow environment and aws in such a way that you can use amplify cli. So given this easy workaround I am asking if there are further concerns like security – wyn Jun 26 '20 at 09:04

0 Answers0