- Newest
- Most votes
- Most comments
This skills tests DOES NOT setup HTTPS. As per the instructions this will only work over HTTP. https://aws-tc-largeobjects.s3-us-west-2.amazonaws.com/DEV-AWS-MO-GCNv2/exercise-3-compute.html
As part of the instructions in task 2, step 3 it states:-
In a new browser window, paste the IP address that you copied. Make sure to remove the ‘S’ after HTTP so you are using only HTTP instead.
There are no steps to setup HTTPs in this excercise. You have completed the task correctly. There is nothing to worry about, all is good.
Gary, honestly this makes me feel really good, but at the same time in the instruction video, when the instructor clicks "open address" next to Public IPv4 address in Instance Summary for [myinstance], she arrives at the window that Riku_Kobayashi arrived at when doing that tutorial. I cannot arrive to this window, for me when I access http it just states on the web browser page "It Works!", and when I try to access https, it gives me an error. (HTTPS is automatically tried when clicking "open address"). I'm sorry I'm so stubborn, but did I really complete this task if I can't view what the instructor is viewing when I followed her instructions to the T?
AWS Skills Builder Link: https://explore.skillbuilder.aws/learn/course/1851/play/85986/aws-technical-essentials;lp=1044
Several things to mention here.. In the excercise it states "The demonstration video below is intended as visual walk-through and not as a hands-on exercise." When the instructor hovered over the link, it did infact show a URL of HTTPs. What you dont see is her browser window open, its already open. I conclude that its impossible for this to work on https and the instructor changed the site to http from https and was left out and not clearly stated.
Also, 3:30 in the video, she states "We are going to be only using http directly" when configuring the security group
You weren't lying when you said this would put everything to rest my friend. Hit me with the 1 2 combo of "do you even listen" and "pay closer attention" in 2 breezy comments. I really appreciate it. I promise to listen more attentively and focus on visual references a little bit less. Thanks again, you are the man Gary!
Hey don’t kick yourself. It’s great you’re learning and trying, it’s not straight forward and so many moving parts.. I’ve been in the game 25 years and there’s always something new to learn. Enjoy reach out anytime.
Hello.
You have httpd installed, but installation is not required.
If httpd is installed, stop it with the following command.
sudo systemctl stop httpd
I also ran the user data script and was able to get it to work correctly.
#!/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=<INSERT REGION HERE>
export DYNAMO_MODE=on
FLASK_APP=application.py /usr/local/bin/flask run --host=0.0.0.0 --port=80
Failed to stop httpd.service: Unit httpd.service not loaded. This is after I created a new instance with this script, and did not install anything with the sudo commands in Amazon EC2 Instance Connect Client.
Can you confirm that the process is running with the following command? Also, have you changed the <INSERT REGION HERE> in the script to the region you are using?
ps aux | grep "/usr/bin/python3 /usr/local/bin/flask run --host=0.0.0.0 --port=80"
When accessing by EC2 public IP address, access as follows.
http://your EC2 Public IP
Thank you so much for responding so quickly. I hope you could help me solve this... Okay, how could I confirm that the process is running with that command ? ps aux | grep "/usr/bin/python3 /usr/local/bin/flask run --host=0.0.0.0 --port=80" Where do I run that command to check this? Edit: I just ran this in EC2 Connect Client: [ec2-user@ip-172-31-2-106 ~]$ ps aux | grep "/usr/bin/python3 /usr/local/bin/flask run --host=0.0.0.0 --port=80" ec2-user 3100 0.0 0.2 222356 2028 pts/0 S+ 01:41 0:00 grep --color=auto /usr/bin/python3 /usr/local/bin/flask run --host=0.0.0.0 --port=80
yes, I changed the region to us-east-2. Here is my Public IPv4 Address. In the tutorial, it is called the open address button to access this Public IPv4 address: Public IPv4 address 18.224.73.69 | open address When I run http://18.224.73.69 I get this: This site can’t be reached 18.224.73.69 refused to connect. Try: Checking the connection Checking the proxy and the firewall ERR_CONNECTION_REFUSED
Thanks for the reply. When the process is running, it looks like this. So, in your case, the process is not started. If the process is not running, the application cannot be accessed.
[ssm-user@ip-172-31-34-37 bin]$ ps aux | grep "/usr/bin/python3 /usr/local/bin/flask run --host=0.0.0.0 --port=80" root 2477 1.6 4.9 285604 48572 ? S 01:57 0:00 /usr/bin/python3 /usr/local/bin/flask run --host=0.0.0.0 --port=80 ssm-user 25038 0.0 0.2 222356 2024 pts/0 S+ 01:57 0:00 grep --color=auto /usr/bin/python3 /usr/local/bin/flask run --host=0.0.0.0 --port=80
Perhaps you are not getting the user data scripts to work well with your EC2. First run the following command in EC2 via Instance Connect instead of user data to see where the problem is.
sudo su - 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=<INSERT REGION HERE> export DYNAMO_MODE=on FLASK_APP=application.py /usr/local/bin/flask run --host=0.0.0.0 --port=80
sudo su -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=<INSERT REGION HERE> export DYNAMO_MODE=on FLASK_APP=application.py /usr/local/bin/flask run --host=0.0.0.0 --port=80 su: user https://aws-tc-largeobjects.s3-us-west-2.amazonaws.com/DEV-AWS-MO-GCNv2/FlaskApp.zip does not exist or the user entry does not contain all the required fields unzip: cannot find or open FlaskApp.zip, FlaskApp.zip.zip or FlaskApp.zip.ZIP. -bash: cd: FlaskApp/: No such file or directory Last metadata expiration check: 2:34:38 ago on Tue Aug 8 00:08:14 2023. Package python3-pip-21.3.1-2.amzn2023.0.5.noarch is already installed. Dependencies resolved. Nothing to do. Complete! ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt' Last metadata expiration check: 2:34:39 ago on Tue Aug 8 00:08:14 2023. Package stress-1.0.4-28.amzn2023.0.2.x86_64 is already installed. Dependencies resolved. Nothing to do. Complete! -bash: syntax error near unexpected token `newline' Usage: flask run [OPTIONS] Try 'flask run --help' for help.Error: Could not import 'application'.
This is what I get when I run that command.
Relevant content
- Accepted Answerasked 5 months ago
- Accepted Answerasked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 9 months ago
Added comment to my answer which will put everything to rest my friend.