A series of scripts to create and easily maintain Amazon AWS EC2 instances of Push Backend.
- A *nix (including MacOS) system
- Ruby 2.1 or greater
The point of this is to make life much easier, since the AWS console is confusing, at best.
There are three steps for this part of the process.
- Create AWS security credentials
- Make sure your dependencies are up to date
- Run generation scripts
Note: If you do not have an Amazon AWS account yet, you'll have to sign up here https://aws.amazon.com. Don't worry, it's free to sign up.
- Follow the steps that Amazon provides to generate and download keys at https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-setting-up.html
- Take note of the
Access Key ID
andSecret Access Key
- Make a copy of the
aws_credentials_template
in this repository and name the copyaws_credentials
- Edit the
aws_credentials
file, replacing the lineswith the values from step 2aws_access_key_id=xxxxxxxxxx aws_secret_access_key=xxxxxxxxxxxx
Note: These scripts require Ruby 2.1 or greater. If you need to install Ruby or manage multiple versions RVM is amazing and easy.
- Verify that you have bundler installed
bundle -v
cd
to the repository- Run
bundle install
to make sure all the dependencies are correct
ruby aws-launch.rb
- When prompted for the name, type in the full name of the organization i.e. "Kyiv Post", not "kyiv_post" or "kyivpost"
The script should handle literally everything else and at the end output some more steps to follow.
- The script automatically creates a new ssh key pair to access your server. Right now there's not a way to set your own, but if you'd like that let me know.
- The instructions at the end give you samples on how to ssh into your sever. Really, you should move the key to your ~/.ssh folder for safe keeping.
- The public IP address is an Amazon Elastic IP, you usually only get ~5 per AWS account, so use them wisely.
- This automatically boots up a
t2.micro
instance. This sits on Amazon's 'free tier' and, in my experience is more than enough to handle moderate traffic. Feel free to upgrade it. - Mosh is automatically enabled, with the correct ports are open. It's great if you're on a mediocore connection.
The Push project has been made under a Knight International Journalism Fellowship with the generous support of the International Center For Journalists and the Organized Crime and Corruption Reporting Project.
Pull requests are awesome, please feel free to submit them.
If you have questions, please contact me.
Christopher Guess [email protected] PGP Key