- An account with Amazon Web Services (https://console.aws.amazon.com)
- A twitter account for the Twitter Bot application we'll be deploying
- Sign into your Amazon Web Services (AWS) account
- Click Services --> Lightsail
- Press create instance
- Choose the options (us-west-2, linux/ubuntu, Node.js, $5/month)
Note: This option will only work for Mac & Linux, unless you have PuTTY installed on your windows machine
- Visit the Lightsail home page (https://lightsail.aws.amazon.com)
- Press the Account button
- Go to SSH Keys
- Scroll down, and press the Download button corresponding to Default
- Move the .pem file from your downloads to your user account's .ssh folder (in my example I assume that all your
downloads go to your user's download folder)
$ mv ~/Downloads/LightsailDefaultPrivateKey-us-west-2.pem ~/.ssh/
- Change the permissions on your private key so that only you are allowed to read from it
$ cd ~/.ssh $ chmod 400 LightsailDefaultPrivateKey-us-west-2.pem
- SSH into your instance by using the public IP of your instance
$ cd ~/.ssh $ ssh -i LightsailDefaultPrivateKey-us-west-2.pem [email protected]
- Go to Lightsail, click on your instance, then click on the Networking tab
- Scroll down to Firewall then add another Custom application using the TCP protocol on port 3000
- SSH into your instance or use Lightsail's browser-based remote desktop (RDP) client
- Clone this workshop's repository
$ git clone https://github.com/SCUACM/cloud-computing-tutorial.git
- Install the necessary packages, then run the application!
$ cd ~/cloud-computing-tutorial/reactjs-app $ npm install $ npm start
- Open your browser, then paste in your instance's IP with :3000 appended to it! (For example, http://34.216.141.44:3000/)
- Log onto https://apps.twitter.com/ and press Create New App
- Fill out the form, then press Create your Twitter application
- Press on the Keys and Access Tokens tab
- Scroll down and click Create my access token
- SSH into your instance or use Lightsail's browser-based remote desktop (RDP) client
- Clone this workshop's repository (skip this step if you already did it for the last application)
$ git clone https://github.com/SCUACM/cloud-computing-tutorial.git
- Create a
keys.json
file with the keys and access tokens you just created. When finished, save and quit by pressingesc
then:wq
thenenter
$ cd ~/cloud-computing-tutorial/python-app $ vi keys.json
{ "consumer_key": "__your key here__", "consumer_key_secret": "__your key here__", "access_token": "__your key here__", "access_token_secret": "__your key here__" }
- Download pip which is a package management system used to install and manage software packages written in Python
$ curl https://bootstrap.pypa.io/get-pip.py > get-pip.py $ sudo python get-pip.py
- Now we'll download Tweepy, an easy-to-use Python library for accessing the Twitter API
$ sudo pip install tweepy
- Once that's finished, you can go ahead and run your
tweetbot.py
! If you want to change the keyword you're searching for, you can change thekeywords
variable inside the python file!$ cd ~/cloud-computing-tutorial/python-app $ python tweetbot.py