Skip to content

Instantly share code, notes, and snippets.

@bahrmichael
Created January 14, 2020 21:18
Show Gist options
  • Save bahrmichael/2656d7e882d995ad931605bd65e8d212 to your computer and use it in GitHub Desktop.
Save bahrmichael/2656d7e882d995ad931605bd65e8d212 to your computer and use it in GitHub Desktop.

Instead of

ANGUALRCONFIG="{\
\"SourceDir\":\"src\",\
\"DistributionDir\":\"dist/ticketshop-frontend\",\
\"BuildCommand\":\"ng build --aot\",\
\"StartCommand\":\"ng serve\"\
}"
AWSCLOUDFORMATIONCONFIG="{\
\"configLevel\":\"project\",\
\"useProfile\":false,\
\"profileName\":\"default\",\
\"accessKeyId\":\"headlessaccesskeyid\",\
\"secretAccessKey\":\"headlesssecrectaccesskey\",\
\"region\":\"eu-central-1\"\
}"
AMPLIFY="{\
\"projectName\":\"core-frontend-sales\",\
\"envName\":\"dev\",\
\"defaultEditor\":\"code\"\
}"
FRONTEND="{\
\"frontend\":\"javascript\",\
\"framework\":\"angular\",\
\"config\":$ANGUALRCONFIG\
}"
PROVIDERS="{\
\"awscloudformation\":$AWSCLOUDFORMATIONCONFIG\
}"

amplify init \
--amplify $AMPLIFY \
--frontend $FRONTEND \
--providers $PROVIDERS \
--yes

I had to first

        - curl "https://d1vvhvl2y92vvt.cloudfront.net/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
        - unzip awscliv2.zip
        - ./aws/install
        - aws2 configure set aws_access_key_id $AWS_ACCESS_KEY_ID
        - aws2 configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
        - aws2 configure set region eu-central-1

and then

ANGUALRCONFIG="{\
\"SourceDir\":\"src\",\
\"DistributionDir\":\"dist/ticketshop-frontend\",\
\"BuildCommand\":\"ng build --aot\",\
\"StartCommand\":\"ng serve\"\
}"
AWSCLOUDFORMATIONCONFIG="{\
\"configLevel\":\"project\",\
\"useProfile\":true,\
\"profileName\":\"default\"\
}"
AMPLIFY="{\
\"projectName\":\"core-frontend-sales\",\
\"envName\":\"dev\",\
\"defaultEditor\":\"code\"\
}"
FRONTEND="{\
\"frontend\":\"javascript\",\
\"framework\":\"angular\",\
\"config\":$ANGUALRCONFIG\
}"
PROVIDERS="{\
\"awscloudformation\":$AWSCLOUDFORMATIONCONFIG\
}"

amplify init \
--amplify $AMPLIFY \
--frontend $FRONTEND \
--providers $PROVIDERS \
--yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment