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.

Figure of the AWS Networking Costs Calculator with Transit Gateway, Client VPN, and VPC Peering services selected.

Figure 1: AWS Networking Costs Calculator

Calculator architecture

The calculator has two main components.

The following diagram shows the calculator architecture.

Figure showing the AWS Networking Costs Calculator high-level architecture with services such as CloudFront, React webapp, IAM role, Cognito identity pool, Calculator API, DynamoDB price cache, pricing scaraper Lambda and EventBridge scheduler

Figure 2: AWS Networking Costs Calculator high-level 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

$ 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

  1. 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.
    Screenshot of the CloudFront console highlighting the distribution domain name to be used for accessing the AWS Networking Costs Calculator

    Figure 3: CloudFront URL for accessing AWS Networking Costs Calculator

    Screenshot of the default home page of the AWS Networking Costs Calculator in a web browser highlighting the CloudFront URL

    Figure 4: Accessing AWS Networking Costs Calculator in a web browser using the CloudFront URL

  2. Select your desired AWS Region from the dropdown menu at the top right, as shown in Figure 5.

    Screenshot of the AWS Networking Costs Calculator showing the selection of AWS region

    Figure 5: Selecting an AWS Region

  3. Choose the AWS services you wish to calculate pricing for. They will appear on the diagram, as shown in Figure 6.

    Screenshot of the AWS Networking Costs Calculator showing selection of the networking services

    Figure 6: Selecting AWS services

  4. Some services may need you to provide extra inputs, as shown in Figure 7.

    Screenshot of the AWS Networking Costs Calculator showing additional inputs for some services such as number of Transit Gateway attachments, Client VPN endpoints, Client VPN connections, and average duration per day

    Figure 7: Additional inputs for some services

  5. 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.

    Screenshot of the AWS Networking Costs Calculator showing how to view monthly recurring costs

    Figure 8: Viewing monthly recurring costs

  6. 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.

    Screenshot of the AWS Networking Costs Calculator showing how to view monthly data processing costs

    Figure 9: Viewing monthly data processing costs

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

  1. 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.
  2. 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.
  3. 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:
    1. Amazon VPC
      1. Site-to-Site VPN
      2. Client VPN
      3. Transit gateway
      4. Network Firewall
      5. VPC endpoint (PrivateLink)
    2. Elastic Load Balancers
      1. Application Load Balancer
      2. Network Load Balancer
      3. Gateway Load Balancer
    3. Amazon Route 53
      1. DNS Firewall
      2. Resolver Endpoints (Inbound and Outbound)
    4. AWS Direct Connect
      We will continue to add more services and features to the tool in the future.
  4. 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

Moshe_Shelly_Blog.jpg

Moshe Shelly

Moshe is a Principal Solutions Architect at AWS. He loves building, putting technology into practice, and has a strong passion for networking. He helps customers design and implement cutting-edge architectures. When he’s not coding, Moshe can be found flying airplanes as a private pilot or playing the guitar.

Mandar_Alankar_Blog.jpg

Mandar Alankar

Mandar is a Senior Networking Solutions Architect at AWS. He is passionate about networking technologies and loves to innovate and help solve complex customer problems. He holds a master’s degree in Telecommunications from University of Colorado Boulder. Mandar lives in Seattle and loves travel and outdoor activities.

Sergio_Pinho_Blog.jpg

Sergio Pinho

Sergio Pinho is a Solutions Architect at AWS. He focuses on compute services and designing cost-effective resilient solutions. Outside of work he enjoys playing sports, hiking and video games.