- Newest
- Most votes
- Most comments
We may need to know which error you are receiving, but due to the formatting issues in the question, I'm going to suggest that it might be a formatting issue. This to how it should look, the newlines are important here.
Also make sure you are working in the same region that you specified below, in this case us-east-2.
#!/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-2
export DYNAMO_MODE=on
export FLASK_APP=application.py
/usr/local/bin/flask run --host=0.0.0.0 --port=80
1)Verify file permissions: Ensure that the script file has executable permissions. You can use the chmod command to add the execute permission if needed:
"chmod +x your_script.sh"
2)Check for internet connectivity: Make sure your EC2 instance has internet connectivity to download the FlaskApp.zip file using wget. If there are any network restrictions or issues, it may fail to download the file.
3)Debugging output: Since you're using the -ex flags in your bash script (#!/bin/bash -ex), it should provide detailed output while executing each command. This can help you identify exactly where the script fails if it encounters any errors.
4)Verify environment variables: Ensure that all the environment variables (SUB_PHOTOS_BUCKET, AWS_DEFAULT_REGION, DYNAMO_MODE) are correctly set or substituted with their appropriate values.
5)Check FlaskApp.zip content: After unzipping FlaskApp.zip, make sure that all the required files, including requirements.txt and application.py, are present in the FlaskApp directory.
6)Review AWS permissions: Ensure that your EC2 instance has the necessary permissions to access the AWS services (e.g., DynamoDB, S3) mentioned in the script. If permissions are not correctly configured, it can lead to failures when interacting with these services.
Relevant content
- asked 17 days ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
What error are you receiving?