CODE IN SKILL BUILDER NOT WORKING PLEASE CHECK WHY

0

#!/bin/bash -ex wget https://aws-tc-largeobjects.s3-us-west-2.amazonaws.com/DEV-AWS-MO-GCNv2/FlaskApp.zip unzip FlaskApp.zip cd FlaskApp/ yum -y install python3 mysql pip3 install -r requirements.txt amazon-linux-extras install epel yum -y install stress export PHOTOS_BUCKET=${SUB_PHOTOS_BUCKET} export AWS_DEFAULT_REGION=<INSERT REGION HERE> export DYNAMO_MODE=on FLASK_APP=application.py /usr/local/bin/flask run --host=0.0.0.0 --port=8

asked a year ago189 views
2 Answers
0

Hello

Have you changed the export this part AWS_DEFAULT_REGION=<INSERT REGION HERE>

profile picture
EXPERT
answered a year ago
  • YES I HAVE DONE THAT

  • Highly suggest posting the specific error that you are getting so that others can help.

0

I changed the script a little, I don't know why the FLASK_APP variable is not being exported in the bash script they give. And I also added the running of the app on another line.

#!/bin/bash -ex
wget https://aws-tc-largeobjects.s3-us-west-2.amazonaws.com/DEV-AWS-MO-GCNv2/FlaskApp.zip
unzip FlaskApp.zip
cd FlaskApp/
yum -y install python3-pip
pip install -r requirements.txt
yum -y install stress
export PHOTOS_BUCKET=${SUB_PHOTOS_BUCKET}
export AWS_DEFAULT_REGION=us-east-1
export DYNAMO_MODE=on
export FLASK_APP=application.py 
/usr/local/bin/flask run --host=0.0.0.0 --port=80

I logged into the machine and saw the flask app was not seeing the environment variable FLASK_APP by looking in the machine logs under /var/log/cloud-init-output.log which is where you will see the execution of the user data of your EC2

answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions