I have been asked to work on an existing aws amplify
reactJs
project. Normally I would simply clone the project repo from either github or bitbucket, but this project is am amplify project and requires a whole set of configuration. I have several aws profiles set-up on the cli, and have access to the aws cludservices for this project, but cannot run the app locally because my aws-exports.js
file does not have the required auhtentication configurations in it.
According to the amplify cli docs for an existing project, I should just be able to run amplify init --app https://bitbucket.org/brooklynva/brooklyn-ocr-poc.git
. However this tried, and thankfully failed, to update the cloudformation stack on aws. It updated the aws-exports.js
file but only with this:
// WARNING: DO NOT EDIT. This file is automatically generated by AWS Amplify. It will be overwritten.
const awsmobile = {
"aws_project_region": "us-east-2"
};
export default awsmobile;
So I then found that running amplify pull --frontend
with some other parameters which I put into a bash file would be the equivalent of running git pull
. After running that command, still nothing was updated in the config file.
#!/bin/bash
set -e
IFS='|'
REACTCONFIG="{\
\"SourceDir\":\"src\",\
\"DistributionDir\":\"build\",\
\"BuildCommand\":\"npm run-script build\",\
\"StartCommand\":\"npm run-script start\"\
}"
FRONTEND="{\
\"frontend\":\"javascript\",\
\"framework\":\"react\",\
\"config\":$REACTCONFIG\
}"
amplify pull \
--frontend $FRONTEND \
--yes
So my question remains, how do I start an already existing aws amplify
app from an existing project and generate the configuration file necessary to run the app locally without having the person who created the app, share that config file with me?