Networking & Content Delivery
Estimate AWS networking costs with a self-hosted calculator
Amazon Web Services (AWS) offers a wide choice of networking services. While these services enable AWS to meet more customer needs around networking, that variety increases the number of available options to consider in making architectural decisions when designing AWS and hybrid networking infrastructure. Cost is one of the main factors that drive architectural decisions for many of our customers.
Estimating the networking costs might be challenging and require checking different pricing pages for each of the services. While the AWS Pricing Calculator does provide a way to estimate these costs, it might not provide in depth networking cost estimations and analysis. This post presents a sample open source project that allows you to run an AWS networking-focused calculator to estimate and visualize the various charges for a given network architecture.
AWS Networking Costs Calculator
AWS Networking Costs Calculator is an open-source web-based pricing estimate tool that allows you to select your AWS Region, the networking services in your architecture, and additional inputs relevant to those services, such as number of endpoints used and the data transferred or processed. It generates a sample diagram that helps visualize the connectivity and flow of traffic. For example, in Figure 1 below, a Transit Gateway, Client VPN, and Virtual Private Cloud (VPC) peering are selected in the AWS US East (N. Virginia) Region. Prices are shown on arrows where individual endpoint and data transfer/data processing charges apply. In the example in Figure 1, the following charges apply:
- $0.02/GB for the Transit Gateway data processing
- $0.01/GB for VPC peering inter-Availability Zone data transfer (each direction)
- $0.1/hour for client VPN endpoint per Availability Zone
The calculator also shows an estimation of the hourly or monthly charges, so you can get an overall estimation of the networking costs for your solution—with a visualization that helps you understand the related costs better.
Calculator architecture
The calculator has two main components.
- A serverless backend part that uses the AWS Price List Query APIs to get the updated prices for the different networking services. This process runs daily inside an AWS Lambda function, with prices cached in Amazon DynamoDB
- A ReactJS front-end web application (hosted on Amazon Simple Storage Service (Amazon S3) and fronted with an Amazon CloudFront distribution), which is the calculator user interface.
The following diagram shows the calculator architecture.
Solution overview
Before you deploy the tool in your AWS account, you need to ensure the following prerequisites are met.
Prerequisites
- A Linux-based OS (as of this writing, there is no Windows deployment script).
- NodeJS (version 18 or later) and NPM. Node and NPM are straightforward to install. To make sure you have them available on your machine, run the following command.
$ npm -v && node -v
7.24.2
v18.16.1
- The AWS Cloud Development Kit (AWS CDK) installed (you can install it with
npm install -g aws-cdk
).
$ cdk --version
2.124.0 (build 4b6724c)
- If you have never used the AWS CDK in the current account and Region, run bootstrapping with npx cdk bootstrap.
npx cdk bootstrap aws://123456789012/us-east-1
- An AWS account to run the backend resources and the AWS Command Line Interface (AWS CLI) (v2) installed and configured. To make sure the AWS CLI is installed and configured on your machine, run the following command. You should get the default user. Make sure it has permissions to deploy the backend resources.
$ aws sts get-caller-identity
{
"UserId": "AIDxxxxxxxxxxxxxxxT34",
"Account": "123456789012",
"Arn": "arn:aws:iam::123456789012:user/admin"
}
Deployment
Once you have verified the prerequisites are met, run the deployment script from the project’s root directory. You can find the source code of the project in the aws-samples networking-costs-calculator GitHub repository.
$ ./deploy.sh
The deployment will take a few minutes to be completed (typically between 5–10 minutes). During this process, two AWS CloudFormation stacks are deployed: NetCalcBackendStack and NetCalcFrontendStack. Once the deployment is complete, you’ll be provided with a CloudFront front-end URL that can be used to access the tool.
How to use the Networking Costs Calculator
- Access the AWS Networking Costs Calculator in a web browser through the front-end URL. This URL is printed at the end of the AWS CDK deployment process, or you can find it in your account on your CloudFront console, as shown in Figure 3.
- Select your desired AWS Region from the dropdown menu at the top right, as shown in Figure 5.
- Choose the AWS services you wish to calculate pricing for. They will appear on the diagram, as shown in Figure 6.
- Some services may need you to provide extra inputs, as shown in Figure 7.
- You can view the recurring costs for each service and total monthly costs for your setup inside the Recurring Costs box, as shown in Figure 8. The prices will be adjusted based on the extra inputs for each service.
- There may be additional data processing or data transfer charges for some AWS services. You can calculate those charges using the Data Processing Costs box, as shown in Figure 9.
How to delete the deployment
To remove the tool and its components from your AWS account, use the following commands:
$ cd backend
$ cdk destroy –all
Considerations
- Cost estimates – The pricing you see in the tool for your network architecture is an estimate. The actual costs you incur may vary depending on factors such as other AWS services used or third-party products in use.
- Calculator pricing – Since this is a self-hosted calculator, the charges related to hosting the tool are billed to the account where the tool is hosted.
- Enhancements to the tool – Not all AWS networking services are available for cost estimates in the tool. As of this writing, the AWS networking services that are available are:
- Amazon VPC
- Elastic Load Balancers
- Amazon Route 53
- AWS Direct Connect
We will continue to add more services and features to the tool in the future.
- Support – As of this writing, there is no official support available for the tool.
Conclusion
The AWS Networking Costs Calculator is a great tool for getting estimates on the networking costs for your architecture. It gives you an straightforward user interface that can not only provides you with recurring costs and data transfer and processing costs estimates but also a visual representation of the networking components and prices on a network architecture diagram. If you run into issues or want to submit a feature request, use the New issue button under the issues tab in the GitHub repository.
About the authors