

Ask HN: What are some good EC2 tutorials for programmers? - jamalkhan


======
Terretta
AWS can build your stack (DNS, servers, DB, LB, etc) for you using "Cloud
Formation":

[http://aws.amazon.com/cloudformation/aws-cloudformation-
temp...](http://aws.amazon.com/cloudformation/aws-cloudformation-templates/)

Look at _"Application Framework Examples"_ and the templates for _"A simple
Ruby on Rails "Hello World" application"_ to start. You can build your whole
stack with a single click.

Later on, if you decide you want to be devops instead of dev, you can learn
about how these templates were written. Go here to roll your own:

[http://aws.amazon.com/cloudformation/aws-cloudformation-
arti...](http://aws.amazon.com/cloudformation/aws-cloudformation-articles-and-
tutorials/)

In the meantime, keep learning Rails and node, and let AWS Cloud Formation set
the servers up for you. That's sort of the point of the cloud.

------
evanlivingston
That's a somewhat difficult questions to answer, and it depends on which
aspect of EC2 you're interested in. EC2 isn't really a thing for which there
are tutorials because EC2 is essentially a server to rent, It's how you use
EC2, and there's hardly a standard for that currently. I think the more
important thing is to become familiar with the Amazon Web Services (AWS) as a
whole, of which EC2 is only a part. There are some AWS SDK's which I find
wildly helpful. Here's the docs for the php sdk
[http://docs.amazonwebservices.com/AWSSDKforPHP/latest/#i=Ama...](http://docs.amazonwebservices.com/AWSSDKforPHP/latest/#i=AmazonEC2)

following other people companies who are using AWS can be a great way discover
ways of using AWS. Netflix operates a great blog.
<http://techblog.netflix.com/>

If you're interested in in just renting a server, and putting Wordpress on it,
there are tutorials for that, and you'll have to deal with setting up a web
server, domain name etc... But perhaps you're interested in learning about how
build out a scalable protein folding cluster, and the set of challenges will
be completely different. AWS only provides the hardware and you must create
whatever you wish to implement.

~~~
jamalkhan
Hi, I am trying to port some of my Rails and Node.js projects from my computer
/ Github. So essentially setting up instances and running the respective
webservers on these EC2 instances.

~~~
jeffbarr
AWS Elastic Beanstalk (<http://aws.amazon.com/elasticbeanstalk/>) will make
this easy.

~~~
rgarcia
AFAIK Beanstalk doesn't support node...is this in the works?

------
malandrew
For very nice tutorials for someone completely new to EC2 and server-side
admin stuff in general, check out Paul Stamatiou's tutorials. here is one of
them: [http://paulstamatiou.com/how-to-getting-started-with-
amazon-...](http://paulstamatiou.com/how-to-getting-started-with-amazon-ec2)

For those that are familiar with the command line and remote servers, but new
to EC2, Flurdy's tutorials are pretty solid

<http://flurdy.com/docs/ec2/>

Besides that if you plan on making any public AMIs, the blog posts by Eric
Hammond of Alestic are required reading and his example github repo for this
task should be checked out.

------
wtfleming
The "Getting started with" guides at
<http://aws.amazon.com/documentation/ec2/> are great. Once you're done with
those might as well just read the docs at there too.

------
strife25
I know it's kind of tangential, but one of the MASSIVE benefits of using EC2
and clouds for hosting is the simplicity of provisioning new machines when
problems occur (nodes dying, high traffic, etc.).

One attitude to take when using Infrastructure as a Service (IaaS) is to
always expect failure - nodes can easily disappear when a problem occurs and
take out your entire website.

The best backup plan you can have for this is to capture the entire
configuration of your stack in some version controlled way. One of the tools I
use for this falls under the domain of "configuration management", with the
best products being Chef[1] or Puppet[2], or just writing a normal bash script
that installs your Rails stack and checks out your code from github.

When utilizing these technologies, I usually do the following:

1\. Create a virtual image that has your CM tools + dependencies installed on
it. 2\. Add a bootstrap script that runs at boot (usually /etc/rc.local on
Linux). This script will acquire and parse user-data[3] that is provided in
the provisioning request to EC2[4], an then kick off your main configuration
logic. 3\. Capture the image and use it as your base image that you perform
deployments from.

Feel free to let me know if you have any questions with this method! It's a
bit overkill at the learning phases of IaaS clouds and OS administration, but
it will save you a TON of time down the road as a programmer.

[1] Chef: <http://www.opscode.com/chef/> [2] Puppet: <http://puppetlabs.com>
[3]
[http://docs.amazonwebservices.com/AWSEC2/2007-03-01/Develope...](http://docs.amazonwebservices.com/AWSEC2/2007-03-01/DeveloperGuide/AESDG-
chapter-instancedata.html) [4] This user-data should contain runtime arguments
that your configuration scripts can use to run properly (e.g. a specific git
commit version or the hostname of your database node).

------
richo
What about EC2 do you want to know? EC2 itself is pretty agnostic, I mean it's
just like having a linux box?

Do you want guides to the EC2 API?

------
wickchuck
I know the title says EC2, but if your just looking for a Linux box at roughly
the same price, then linode is also a very good option. Railscasts has a
couple of screencasts that deal directly with setting up a linux box with
Rails and Postgres that I would highly recommend to someone just getting
started. It is a pro cast, so it would cost 9 a month, but definitely worth
the price.

~~~
dbecker
I think this is a great suggestion. Linode is much easier to get started with
than AWS if scalability isn't a priority.

A linode VPS is just a standard linux server, while EC2 has lots of quirks.

For instance, AWS/EC2 has a variety of types of storage, and their persistence
properties aren't always what you'd expect. So, EC2 requires you learn how to
run a linux server plus a bunch of AWS specific stuff. Linode only requires
basic linux administration skills.

If you are set on EC2, I found boto very useful for keeping track of my AWS
resources.

------
sangupta
I have found the EC2 guide at
[http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/EC...](http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html)
to be the most useful.

PS: I have started using EC2 in the past few months only. Their forums are
also pretty informative and supportive.

------
iamondemand
We have about 100 AWS how-to guides - simple work flow scripts that support
new AWS user getting started as well as advanced ones - check them out
<http://www.newvem.com/learning-center/how-to-guides/>

We also have a community of cloud experts that contributed on a weekly basis
best practices, case studies and bunch of AWS goodies.
<http://www.newvem.com/amazon-cloud-knowledge-center/>

------
sandyshankar
I found this to be a good tutorial for setting up a nodejs server on EC2
[http://cuppster.com/2011/05/12/diy-node-js-server-on-
amazon-...](http://cuppster.com/2011/05/12/diy-node-js-server-on-amazon-ec2/)

------
DharmaSoldat
Go look at the SDK docs... they're not half bad. I got a system up and running
with them (not knowing anything about AWS beforehand) in a day or two. Most of
it is just knowing the lingo and getting some practice in.

------
dirktheman
I wrote a tutorial on this a while ago:
[http://www.dirktheman.com/tutorial/setting-up-your-lamp-
stac...](http://www.dirktheman.com/tutorial/setting-up-your-lamp-stack-on-
aws/)

------
ef4
It sounds like maybe what you really want to learn is the basics of Linux
system administration. If you start with that, it will become much clearer how
you can use EC2 to host your applications.

------
vanwilder77
for what language/ framework, do you want the tutorials for? Can you be more
specific about it?

~~~
jamalkhan
Rails and Node.js

~~~
tim_moon
[http://catchvar.com/nodejs-server-and-web-sockets-on-
amazon-...](http://catchvar.com/nodejs-server-and-web-sockets-on-amazon-ec2-w)

This is what I found useful when I was first setting up Node.js on EC2.

------
checker659
Would love to know this too.

