Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move image resources to the web; rename and update a few posts

  • Loading branch information...
commit f5fd3fcd6e7d20ee01463406b28c720f89be297d 1 parent bc57775
@CraigCottingham authored
View
42 _posts/2011-03-15-ec2-getting-started.mdown → _posts/2011-03-15-ec2-getting-started.md
@@ -60,8 +60,34 @@ Add these variables to your environment, and make sure they're loaded into your
You have to have an AWS account, and have signed up for EC2.
Go to <http://aws.amazon.com/account/> and click on the link that reads "Security Credentials".
-Log into your AWS account when prompted. Scroll down to "Access Credentials", and click on the
-tab that reads "X.509 Certificates".
+Log into your AWS account when prompted. Scroll down to "Access Credentials".
+
+#### Access Keys
+
+The command line tools access AWS through a web service, which requires access keys.
+
+Click on the tab that reads "Access Keys", then on "Create a new Access Key". After a moment,
+you should see a new entry under "Your Access Keys".
+
+<div markdown="1" class="screenshot">
+![Screenshot of AWS Access Credentials, Access Key][aws_access_key]
+</div>
+
+Copy the string under "Access Key ID" and save it to a file in the directory pointed to by
+the `EC2_PRIVATE_HOME` environment variable (for instance, `aws-access-key`).
+
+You'll also need to save the secret access key, so click on "Show" next to the access key ID.
+
+<div markdown="1" class="screenshot">
+![Screenshot of AWS Access Credentials, Secret Access Key][aws_secret_access_key]
+</div>
+
+Copy this string and save it to a different file in `EC2_PRIVATE_HOME` (for instance,
+`aws-secret-access-key`).
+
+#### X.509 Certificates
+
+Next, click on the tab that reads "X.509 Certificates".
<div markdown="1" class="screenshot">
![Screenshot of AWS Access Credentials, X.509 Certificates][aws_credentials_x509]
@@ -69,7 +95,7 @@ tab that reads "X.509 Certificates".
Click on "Create a new Certificate". After a moment, you'll get a dialog box containing buttons
with which you can download your newly-created private key and certificate. Click on each
-button in turn, and download the files to the directory named `~/.ec2`.
+button in turn, and download the files to the directory named `EC2_PRIVATE_HOME`.
<div markdown="1" class="screenshot">
![Screenshot of AWS X.509 Certificate download][aws_x509_created]
@@ -82,7 +108,7 @@ create a new one.
Finally, create an SSH keypair like so:
{% highlight sh %}
- $ ec2-add-keypair ec2-keypair > $EC2_PRIVATE_HOME/id_rsa-ec2-keypair
+ $ ec2-add-keypair ec2-keypair -O `cat $EC2_PRIVATE_HOME/aws-access-key` -W `cat $EC2_PRIVATE_HOME/aws-secret-access-key` > $EC2_PRIVATE_HOME/id_rsa-ec2-keypair
$ chmod 600 $EC2_PRIVATE_HOME/id_rsa-ec2-keypair
{% endhighlight %}
@@ -106,6 +132,10 @@ correctly.
[Rackspace Cloud](http://www.rackspace.com/cloud/), at least not yet.
EC2 is just what I'm working with at the moment.
-[aws_credentials_x509]: /images/aws_credentials_x509.png
+[aws_access_key]: http://f.cl.ly/items/2r0W081D0y472B0c0i3x/aws_access_key.png
+
+[aws_secret_access_key]: http://f.cl.ly/items/2L0D1G2I051A0g030d1J/aws_secret_access_key.png
+
+[aws_credentials_x509]: http://f.cl.ly/items/11461t2M0f1f0l0S3d2f/aws_credentials_x509.png
-[aws_x509_created]: /images/aws_x509_created.png
+[aws_x509_created]: http://f.cl.ly/items/38470P1K44432W0M1l1R/aws_x509_created.png
View
14 _posts/2011-03-16-babys-first-ec2-instance.mdown → _posts/2011-03-16-babys-first-ec2-instance.md
@@ -39,14 +39,14 @@ is based on the American East Coast, I'm going to use `us-east`. Also, for this
I'm going to use a 32-bit instance from Amazon that uses S3 as a backing store.
{% highlight sh %}
- $ ec2-run-instances --group default --key ec2-keypair ami-d59d6bbc
+ $ ec2-run-instances --group default --key ec2-keypair ami-e8249881
{% endhighlight %}
About the parameters and their values:
* Replace `ec2-keypair` with the name of the keypair you generated in the initial setup,
if necessary.
-
+
Open the firewall for SSH and ICMP connections. Note that these operations are on a
security group (`default` by, well, default); once you have done them once for your account,
you shouldn't need to again. [^fn3]
@@ -65,7 +65,7 @@ Make sure that the instance is running:
ip-10-244-15-197.ec2.internal running ec2-keypair 0 \
m1.small 2011-03-15T22:10:26+0000 us-east-1b aki-407d9529 \
monitoring-disabled 50.17.139.123 10.244.15.197 \
- instance-store paravirtual xen
+ instance-store paravirtual xen
$ ping 50.17.139.123
PING 50.17.139.123 (50.17.139.123): 56 data bytes
64 bytes from 50.17.139.123: icmp_seq=0 ttl=43 time=83.324 ms
@@ -107,7 +107,7 @@ opened up the SSH port, we can log in as this user:
___|\___|___|
See /usr/share/doc/amzn-ami/image-release-notes for latest release notes. :-)
- [ec2-user@ip-10-244-15-197 ~]$
+ [ec2-user@ip-10-244-15-197 ~]$
{% endhighlight %}
This is a full-fledged Linux system, albeit a little light on the installed packages. [^fn1]
@@ -117,7 +117,7 @@ You can do all the things you'd expect to be able to do on a Linux system:
[ec2-user@ip-10-244-15-197 ~]$ yum check-update
Loaded plugins: fastestmirror, security
Skipping security plugin, no data
-
+
aws-amitools-ec2.noarch 1.3.57676-1.1.amzn1 amzn
aws-apitools-as.noarch 1.0.33.1-1.1.amzn1 amzn
aws-apitools-ec2.noarch 1.3.62308-1.1.amzn1 amzn
@@ -138,7 +138,7 @@ You can do all the things you'd expect to be able to do on a Linux system:
[ec2-user@ip-10-244-15-197 ~]$ sudo yum upgrade
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
- amzn | 2.1 kB 00:00
+ amzn | 2.1 kB 00:00
Skipping security plugin, no data
Setting up Upgrade Process
Resolving Dependencies
@@ -197,5 +197,5 @@ up in `ec2-describe-instances` any more.
lost. EBS-backed instances can be stopped without terminating, which means they
remain known to EC2 and can be restarted again. I'll show an example of this in a
later post.
-
+
[^fn3]: But it won't hurt if you do. You'll just get a warning to that effect.
View
42 _posts/2011-03-17-ec2-ebs-instance.mdown → _posts/2011-03-17-ec2-ebs-instance.md
@@ -20,7 +20,7 @@ for EBS-backed instances.
{% highlight sh %}
$ ec2-run-instances --group default --key ec2-keypair \
--block-device-mapping "/dev/sda1=:16:false" --instance-initiated-shutdown-behavior stop \
- --disable-api-termination ami-76f0061f
+ --disable-api-termination ami-1624987f
{% endhighlight %}
About the parameters and their values:
@@ -45,8 +45,8 @@ Make sure that the instance is running.
domU-12-31-39-00-DD-83.compute-1.internal running hrworx-keypair 0 \
m1.small 2011-03-16T15:22:45+0000 us-east-1a aki-407d9529 \
monitoring-disabled 50.17.77.114 10.254.226.113 ebs paravirtual \
- xen
- BLOCKDEVICE /dev/sda1 vol-5a745032 2011-03-16T15:23:06.000Z
+ xen
+ BLOCKDEVICE /dev/sda1 vol-5a745032 2011-03-16T15:23:06.000Z
$ ping 50.17.77.114
PING 50.17.77.114 (50.17.77.114): 56 data bytes
64 bytes from 50.17.77.114: icmp_seq=0 ttl=44 time=81.047 ms
@@ -83,7 +83,7 @@ Log in as `ec2-user`.
___|\___|___|
See /usr/share/doc/amzn-ami/image-release-notes for latest release notes. :-)
- [ec2-user@domU-12-31-39-00-DD-83 ~]$
+ [ec2-user@domU-12-31-39-00-DD-83 ~]$
{% endhighlight %}
Let's have a look at the EBS volume that's being used for root.
@@ -110,7 +110,7 @@ we allocated.
old desc_blocks = 1, new_desc_blocks = 1
Performing an on-line resize of /dev/sda1 to 4194304 (4k) blocks.
The filesystem on /dev/sda1 is now 4194304 blocks long.
-
+
[ec2-user@domU-12-31-39-00-DD-83 ~]$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/xvda1 16513960 897836 15448528 6% /
@@ -126,7 +126,7 @@ and restarted. Copy some text to a file in the `ec2-user`'s home directory. [^fn
{% highlight sh %}
[ec2-user@domU-12-31-39-00-DD-83 ~]$ echo 'Woot!' > persistent.txt
- [ec2-user@domU-12-31-39-00-DD-83 ~]$ cat persistent.txt
+ [ec2-user@domU-12-31-39-00-DD-83 ~]$ cat persistent.txt
Woot!
{% endhighlight %}
@@ -135,7 +135,7 @@ the instance should stop rather than terminate, when we launched it).
{% highlight sh %}
[ec2-user@domU-12-31-39-00-DD-83 ~]$ sudo shutdown -h now
-
+
The system is going down for system halt NOW!DD-83 (pts/0) (Wed Mar 16 15:53:
[ec2-user@domU-12-31-39-00-DD-83 ~]$ Connection to 50.17.77.114 closed by remote host.
Connection to 50.17.77.114 closed.
@@ -148,8 +148,8 @@ Check that the instance has actually shut down. [^fn2]
RESERVATION r-0cb1d861 331055354537 default
INSTANCE i-b2719add ami-76f0061f stopped hrworx-keypair 0 \
m1.small 2011-03-16T15:22:45+0000 us-east-1a aki-407d9529 \
- monitoring-disabled ebs paravirtual xen
- BLOCKDEVICE /dev/sda1 vol-5a745032 2011-03-16T15:54:10.000Z
+ monitoring-disabled ebs paravirtual xen
+ BLOCKDEVICE /dev/sda1 vol-5a745032 2011-03-16T15:54:10.000Z
{% endhighlight %}
Restart the instance. Wait a minute for it to come up, then check to make sure that it's running.
@@ -163,8 +163,8 @@ Restart the instance. Wait a minute for it to come up, then check to make sure t
domU-12-31-39-09-48-D5.compute-1.internal running hrworx-keypair 0 \
m1.small 2011-03-16T19:28:42+0000 us-east-1a aki-407d9529 \
monitoring-disabled 50.16.85.142 10.210.79.35 ebs paravirtual \
- xen
- BLOCKDEVICE /dev/sda1 vol-5a745032 2011-03-16T19:28:59.000Z
+ xen
+ BLOCKDEVICE /dev/sda1 vol-5a745032 2011-03-16T19:28:59.000Z
{% endhighlight %}
Note that the public IP address changed from the previous run.
@@ -177,18 +177,18 @@ Log in, and go looking for the file that was stashed in `ec2-user`'s home direct
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '50.16.85.142' (RSA) to the list of known hosts.
Last login: Wed Mar 16 15:36:00 2011 from NNN-NNN-NNN-NNN.lightspeed.mssnks.sbcglobal.net
-
+
__| __|_ ) Amazon Linux AMI
_| ( / Beta
___|\___|___|
-
+
See /usr/share/doc/amzn-ami/image-release-notes for latest release notes. :-)
[ec2-user@domU-12-31-39-09-48-D5 ~]$ ls -l
total 4
-rw-rw-r-- 1 ec2-user ec2-user 6 Mar 16 15:51 persistent.txt
- [ec2-user@domU-12-31-39-09-48-D5 ~]$ cat persistent.txt
+ [ec2-user@domU-12-31-39-09-48-D5 ~]$ cat persistent.txt
Woot!
-{% endhighlight %}
+{% endhighlight %}
Woot, indeed.
@@ -207,25 +207,25 @@ in the filesystem.
{% highlight sh %}
$ ec2-describe-volumes
VOLUME vol-006f4868 16 snap-cba692a1 us-east-1b available 2011-03-17T01:53:49+0000
-
+
$ ec2-attach-volume vol-006f4868 -i i-b2719add -d /dev/sda2
ATTACHMENT vol-006f4868 i-b2719add /dev/sda2 attaching 2011-03-17T02:55:11+0000
-
+
$ ssh -i $EC2_KEYPAIR ec2-user@50.16.85.142
Last login: Thu Mar 17 02:58:49 2011 from NNN-NNN-NNN-NNN.lightspeed.mssnks.sbcglobal.net
-
+
__| __|_ ) Amazon Linux AMI
_| ( / Beta
___|\___|___|
-
+
See /usr/share/doc/amzn-ami/image-release-notes for latest release notes. :-)
-
+
[ec2-user@ip-10-196-37-162 ~]$ mkdir mnt
[ec2-user@ip-10-196-37-162 ~]$ sudo mount /dev/sdb1 mnt
[ec2-user@ip-10-196-37-162 ~]$ ls -l mnt/home/ec2-user/
total 4
-rw-rw-r-- 1 ec2-user ec2-user 6 Mar 17 01:58 persistence.txt
- [ec2-user@ip-10-196-37-162 ~]$ cat mnt/home/ec2-user/persistence.txt
+ [ec2-user@ip-10-196-37-162 ~]$ cat mnt/home/ec2-user/persistence.txt
Woot!
{% endhighlight %}
View
BIN  images/aws_credentials_x509.png
Deleted file not rendered
View
BIN  images/aws_x509_created.png
Deleted file not rendered
Please sign in to comment.
Something went wrong with that request. Please try again.