General AWS Notes - youdar/How-to GitHub Wiki

General AWS Notes

Note related to issues found while starting EC2 instance

When creating an Ubuntu instance, use Ubuntu version of 20 or higher, otherwise the python version will be old
and you will need to upgrade it.

No pip3 (and general update)

sudo apt-get update && sudo apt-get dist-upgrade
sudo apt full-upgrade
sudo apt install -y python3-pip python3 python3-setuptools build-essential libssl-dev libffi-dev python3-dev python3-venv

sudo reboot

Create a new user
Based on AWS instructions

SSH to the new instance using the ubuntu username
then:

sudo adduser <user name> --disabled-password
sudo usermod -aG sudo <user name>
sudo passwd <user name>
sudo su - <user name>
mkdir .ssh
chmod 700 .ssh
touch .ssh/authorized_keys
chmod 600 .ssh/authorized_keys
# Create other directories and rsa keys 
exit
# setup the  <user name> password
sudo passwd  <user name>

sudo reboot

Connection to Prefect.io
Add to crontab: @reboot nohup prefect agent local start --key "<Key>" > ~/tmp/prefect_agent.log &
and run nohup prefect agent local start --key "<Key>" > ~/tmp/prefect_agent.log &
You should be able to see the agent in Prefect.io dashboard

⚠️ **GitHub.com Fallback** ⚠️