30 points · by jamescarl · 12y ago · 54 comments
For the love of all that is good, don't do this for anything beyond random hobbyist screwing around. A Dropbox compromise shouldn't risk your entire company's server infrastructure.
> If you only have need for one free tier instance leave it running.
No, because the 750 hours/month can be used by more than one instance. You could, for example, try out database clustering by running two t1.micro instances for two weeks.
> Finally resist the urge to use your GUI when working with your project even when your working with your project on a local machine you’ll find that as you move along with your project you’ll be in better control of the project when it’s on the remote server.
The AWS Console is perfectly usable for 99% of what you'll need to do. Most users won't need anything beyond it.
- Encrypt the pem file with a gpg passphrase you can memorize or put in a password manager
or
- Create a new IAM AWS account with a strong password, turn on 2-factor authentication, and grant access to the keys bucket for just that account. Make sure you turn on S3-side AES256 bit at-rest encryption for the file.
The latter still has the risk of a complete AWS breach and S3 encryption key compromise, or someone hacking into your admin account somehow (in which case you have bigger problems), but that seems much less likely than say someone just snagging your laptop and getting the key off of it.
In practice I have a single jump node in a VPC facing the internet in a security group with my IP whitelisted that has 2-factor authentication with a PAM module for google authenticator and a strong password, so they would need my phone, the password, my IP, and the backend nodes' private key to get to any machine.
I, too, was astounded that anybody would be recommending keeping your keys 'public' like this. By all means, keep it on a few USB sticks that are nicely secure - and have a good plan in place in case you lose one.
There is a reason that Amazon only configures one user with only one key, and it's not because that's how sane people access their machine.
I believe the author was referring to navigating the filesystem and running commands via CLI (e.g. `cd` and `ls`, not `ec2-describe-instances`).
That key is for initial access to provision your machine, after which you should have a more sophisticated means of managing users, as certainly, if you are doing anything of much importance, you will eventually need at least 2.
AWS has tons of weird/interesting quirks - I thought this article was going to be about those.
Here's my 5 tips for AWS...
- SQS: encodes messages by default! plan accordingly if you are going to be sending large bodies (265K max).
- ELBs: they need time to warm up if you get a huge traffic spike. ELBs won't start scaling unless that traffic is sustained for a certain time (usually minutes).
- S3: watch out for "eventual consistency" if you're going to upload lots of files and try to access them right away - they might not be available immediately.
- Cloudwatch: set up alarms to make sure your billing never goes over threshold X in time Y. If someone compromised your account (because you uploaded your .pem file in cleartext to dropbox) and is mining bitcoins on your machines, you'll be notified.
- VPC: if you're going to build a services-oriented infrastructure, consider using a VPC! Unless you need to have all your services exposed to the public internet, it could save you a lot of time and security configuration trouble.
This is only true in the "US Standard" region. Other regions get read-after-write consistency (but not read-after-update, read-after-delete, etc). "US Standard" is the only bi-coastal S3 region, so I guess that consistency level would be too expensive, latency-wise.
Crash Course on the Filesystem Hierarchy Standard @ http://sysadmincasts.com/episodes/12-crash-course-on-the-fil...
Crash Course on Common Commands @ http://sysadmincasts.com/episodes/13-crash-course-on-common-...
Crash Course on Man Pages @ http://sysadmincasts.com/episodes/19-crash-course-on-man-pag...
Edit: Please don't just downvote when I rebut sarcasm/snark with fact. Discuss!
Tip 0.1: Use Vagrant with an EC2 box, and just 'vagrant up' yourself a fully operational machine.
If your Ansible scripts are in Ruby you've done something very odd, and if they're messy it's your own fault. Mine are pretty clean, and once built they work the same way for subsequent runs.
The popular options are in ruby. Just because you use a less popular one that is written in python doesn't change the main point.
AMIs are nice - but they're merely snapshots of an end product. Being able to get to that end product in a repeatable, idempotant and self-documenting fashion is just as nice.
So is being able to create a virtual image on your own machine with the same end product.
FWIW, Vagrant lets you specify an AMI in its box description, so you get the best of both of your worlds there.
No, they make it slower and more complex. The idea being that after you have built a config, future clones will be easier. But you already get a better solution just setting up a server and then making an AMI from it. Cfengine and friends offer quite literally zero benefits for this sort of scenario.
2nd, know your usage upfront before you incur thousands of dollars in usage fees! services like dynamoDB can become very expensive very fast!