A static site in a bucket can only serve files. The Monster Market will need code running somewhere, and in AWS the plainest somewhere is EC2, Elastic Compute Cloud: the service that rents virtual machines.
An instance
An instance is one such machine. It has CPUs, memory, a disk, a private address in a network, usually a public address too, and an operating system you log in to and change as you please. It is yours from the moment it starts until you terminate it, and it is billed by the hour the whole time, used or not.
The four choices
Launching an instance means answering four questions, each of which has its own lesson in this chapter:
| Choice | Meaning | Example |
|---|---|---|
| image | the disk it boots from: an operating system plus whatever was baked in | Amazon Linux 2023 |
| type | its size: how many CPUs, how much memory | t3.micro |
| network | which network and subnet it plugs into | the one every region comes with |
| security group | its firewall: which ports accept traffic from where | port 80 from anywhere |
The first two decide what the machine is. The last two decide who can reach it.
Looking at what you have
aws ec2 describe-instances{
"Reservations": []
}Nothing yet. describe-instances lists machines inside reservations, one reservation per launch request, so an account with no machines shows an empty list. After the next lessons this answer will be long.
What it costs
A t3.micro, the smallest common size, is about one cent an hour: roughly seven dollars for a month. An m5.large with two CPUs and eight gigabytes is about ten cents an hour, seventy dollars a month. The budget from Chapter 1 is about to matter.