You can use the virtual servers provided by the Elastic Compute Cloud (EC2) service to do most things a physical server can do, from hosting web sites or applications to creating clusters of servers for on-demand processing of large data sets. In this chapter we demonstrate how you can configure and deploy some simple instances in EC2, to give you a basic introduction to working with instances in the EC2 environment.
The applications in this chapter focus mainly on the EC2 service alone, although one example also uses the Simple Storage Service (S3). In Chapter 9 we discuss EC2 instances again in the context of deploying a distributed application that also takes advantage of the S3 and Simple Queue Service (SQS).
If you run a public-facing service on EC2, such as a web site or web application, you will want to make your instance accessible via a user-friendly domain name that your users can remember. With standard servers you would achieve this goal by purchasing a domain name and configuring the Domain Name System (DNS) settings for that domain to refer to your server’s IP address. However, this approach is only really workable if your server has a static IP address that does not change over time. As we discussed in Network Addressing” in Chapter 6, EC2 does not allow network addresses to be statically assigned to instances.
When you start an EC2 instance, the virtual machine is assigned IP and DNS addresses that will only refer to your instance ...