1. Pricing options
Amazon provides four different pricing options to use/rent their EC2 - compute infrastructure.
Google for “ec2 pricing” and click the first hit to browse through the different pricing options.
2. AWS pricing calculator
One of the best ways to save costs is to understand, estimate and plan your budget. AWS calculator provides a nice tool to estimate not only your on-demand costs, but also gives you options to compare on-demand with reserved pricing options.
Google for “aws calculator” and click the first hit to go to the AWS calculator.
2.1. Estimated monthly bill
In the AWS monthly calculator;
Expand the Amazon EC2 Instances row.
Give a description.
Click the “cog” icon and choose the “Linux on m4.large” for Type.
Expand the Amazon EBS Volumes row.
Give a description.
Enter “150” for Storage and “150” for Snapshot storage.
2.2. Savings using reserved instances
Clicking on the “cog” icon for the “Type” shows the pricing difference and saving options by using reserved instances, compared to the on-demand instances.
Clicking on the “cog” icon for the “Billing Option” shows the savings options based on upfront payments.
2.3. Cost break down
Click on “Estimate of your monthly Bill” tab to look at the break down of the total estimate, at different service levels.
3. Spot instances
Spot instances offer the best pricings of all other options. But it does come with a caveat, spot instances could be terminated with a few minutes of notices. This scenario makes spot instances attractive in some situations, but not in other cases.
Google for “aws spot pricing” and click the first hit, to browse through the spot instance saving options.
3.1. Launch Instance Wizard
There are different ways by which spot instances could be requested. In this tutorial, we will place a spot request, using the “Launch Instance” option.
From the EC2 console, left hand menu, click “Instances”.
Click “Launch Instance” from the EC2 instances window.
3.2. Choose AMI
In the Launch Instance wizard Step 1, scroll down to the Ubuntu Server 16.0
4 LTS AMI and click “Select”
3.3. Choose an Instance Type
In the Step 2, scroll down and click to chose m4.large as the instance type.
Cllick “Next: Configure Instance Details” button to continue.
3.4. Set the Spot price
In the Step 3, check the box for “Purchasing option - Request Spot instances”.
Enter the appropriate maximum price.
Click “Review and Launch” button.
3.5. Request Spot Instances
Choose a keypair.
Acknowledge the note.
Click “Request Spot Instances” button.
Close any confirmation windows.
3.6. Spot history
From the EC2 left hand menu bar, click “Spot Requests”, to see a list of all your spot requests and their status.
3.7. Spot pricing history
In the spot requests page, click “Pricing History” to look at the pricing history for the m4.large instance. Adjust the “Date range” to get an understanding on the pricing history and its fluctuations.
3.8. Cancel spot requests
Cancel spot requests, by selecting the appropriate request and choose the “Cancel spot request” option in the “Actions” menu.