Despite the widespread use of automation within IT and development teams, there are still cases where it makes...
sense to manually spin up infrastructure.
For example, it's quicker to spin up an Amazon EC2 server instance manually to test a new version of an application, validate a use case or run a performance test.
But first, it's useful to understand the process, along with all the required inputs. These seven steps can help.
Step 1: Select an Amazon Machine Image
To spin up an EC2 server manually, first navigate to the EC2 console within your AWS account. On the EC2 service homepage, you'll see an option to launch an instance.
This will take you into the launch wizard. Next, select an Amazon Machine Image (AMI), which is the OS you'll use for the instance.
Think of an AMI as a golden image for your VM. The OS is already installed and baked into the image, and in many cases, an AMI will include additional software, too.
During the AMI selection phase, you can choose from a variety of different OSes and versions. AWS builds the images included within its EC2 quick starts, sometimes in partnership with the provider of the OS. There are options for standard OS versions, along with AMIs that include additional software, such as Windows Server 2016 with SQL Server Standard.
Users do not need to own the license for AMIs with enterprise OSes and software included. Instead, the cost for that software is rolled into the hourly run rate for the instance.
In addition to quick start images, teams can build their own custom AMIs or select ones from AWS Marketplace that include additional third-party software.
Step 2: Select an instance type
Next, you'll need to choose an instance type.
Similar to physical hardware, EC2 server instances have limits in terms of CPU cores, memory, storage and networking. You'll need to pick a fixed instance type to power your new VM. But don't worry too much if you pick the wrong size; you can move to a different instance type later, if needed.
AWS groups its instances into families to simplify the selection process. For example, there are instance types optimized for memory, storage and compute, along with others that are great candidates for general-purpose workloads.
Step 3: Configure instance details
This step enables you to customize your EC2 server. You can move an instance to a different virtual network, enable detailed monitoring to collect per-minute performance metrics and configure protections from accidental terminations.
You can change any of these configurations after you launch an instance, with the exception of network settings; you can't move an instance off an Amazon Virtual Private Cloud after it's deployed there. You can, however, capture an image of the instance and redeploy it elsewhere.
Another important input in this step is hidden under the Advanced Details section. Within the User data field, developers can include shell scripts that will execute when the instance launches. This is a great way to bootstrap an application on the fly with packages, configuration files and source code.
Step 4: Add storage
Next, customize the disk configuration of your EC2 server. These disks typically use the Elastic Block Store (EBS) service, which is akin to a network-attached storage system, much like iSCSI.
The root volume will be used to host the OS. You can also attach additional EBS volumes to act as secondary disks within the OS.
There are different volume types for EBS. For production workloads, steer clear of magnetic-based volume types, as they are subject to read/write latency. For consistent and reliable performance, select a solid-state drive-based volume type.
Step 5: Tag instances
Next, use AWS' tagging feature to virtually label your EC2 instance. This adds metadata to your server so you can easily identify it in the console. Tags are a great way to categorize and filter your resources and can also help produce detailed billing reports.
For example, you can add multiple key-value pairs as tags. The Name key gives you the ability to label the instance with a server name. You may also want to denote that the instance belongs to your development environment, rather than production. You can use any key names that make sense for your environment.
Step 6: Configure security
The EC2 service includes security groups, which act as a stateful firewall service for your VMs. You must deploy your EC2 server into a new or existing security group.
These groups are highly configurable. You can create both inbound and outbound rules and be explicit about the corresponding ports, protocols and source IP address ranges.
You don't need to create an individual group for every server. For example, you can create one security group for your web servers and deploy an entire fleet of instances into that group.
Step 7: Review and launch
The final step to manually spin up an EC2 instance is to verify that all your inputs are correct.
If everything looks good, click the launch button to start the deployment process. Create and associate an encryption key-pair with the instance, as this lets you securely access it with a private key.
For Linux, use the passwordless Secure Socket Shell to connect to your server. For Windows, use the private key to decrypt the local administrator password and sign in with Remote Desktop Protocol.
Store your private key in a safe place. AWS does not store a copy, so if you lose the key, you could lose access to your server.