AWS Best Practices

From UCSC Genomics Institute Computing Infrastructure Information

When using AWS, there are a few things to keep in mind in order to keep costs down:

EC2

Instances: When using instances, always pick and instance type that just qualifies for what you need, nothing much larger, otherwise it's wasted CPU time which costs more. Also, shut down your instance as soon as you no longer actively need it, as instances that are shut down do not accrue cost.

EBS Volumes: When you create an EBS volume, the volume accrues cost whether or not you have it attached to an instance, and whether or not it actually has data in it. Do not use EBS volumes for long term storage when possible, as EBS volumes are much more expensive per GB than S3 for storage.

Also, if you need to spawn many instances for a short period of time, always try to use AWS "spot" instances to do the work when possible. Usually it takes a little waiting in order to successfully take advantage of spot instances, but the cost is 1/4 to 1/20 the cost of an on-demand instance.

S3

Remember that storing data in S3 costs money based on the amount of time the data spends in S3. If you don't plan on using the data in the near term, consider moving it to Glacier or Deep Glacier in order to save money on the storage. You can always pull the data back to regular S3 later if needed.

Tagging

It is extremely important to tag every single resource you use in AWS with the tag key "Owner", with the value being your IAM login name (i.e. your email address). Many EC2 and S3 resources will actually be deleted if not properly tagged, so make sure you do it as soon as you create a resource. Any resource, such as a Lambda, Elastic LoadBalancer, etc can be tagged. This is so when cleanup time comes, we can see who owns what and ask around about the status of things in general.