Using The Good Parts Of AWS

There was a fascinating Twitter thread on how to use the “good” parts of AWS, from an ex-AWS engineer:
https://twitter.com/dvassallo/status/1154516910265884672 . Click to expand the below image.

Using the good parts of AWS, from a former AWS engineer.

Bottom line: He recommends building your services to use AWS EC2, DynamoDB, etc but avoiding abstractions such as Lambda and API Gateway. There’s an interesting discussion on this thread on HN:
https://news.ycombinator.com/item?id=20545561 .

Amazon Cloud9 IDE Python 3

I spent today morning pulling my hair out trying to get a Python 3 application running within AWS’ Cloud9 IDE. Essentially the problem is that if you pip install some-package, that package only becomes available within the Python 2 runner, not within the Python 3 runner (the current Cloud9 machine image includes Python 2 aliased as python, and Python 3 available through python3).

Fortunately for me, someone else had the same problem, and an Amazon staffer suggests creating a virtual environment: https://forums.aws.amazon.com/thread.jspa?messageID=822214&tstart=0 . I followed the steps mentioned, but it didn’t work – pip still installed dependencies for Python 2. I wonder if this staffer forgot to mention another step, such as remapping the pip command to a Python 3 install.

What finally did work was calling the pip command through the python3 interpreter, like so:

First, ensure pip is installed:

python3 -m ensurepip --default-pip    

Then upgrade pip:

python3 -m pip install --upgrade pip setuptools wheel

Then you can install any requirements of your app, such as BeautifulSoup:

sudo python3 -m pip install --upgrade bs4

And after all that, my Python 3 app was able to access the BeautifulSoup dependency.