Easily build complex reports
Monitoring and efficiency metrics
Custom cost allocation tags
Network cost visibility
Organizational cost hierarchies
Budgeting and budget alerts
Discover active resources
Consumption-based insights
Alerts for unexpected charges
Automated AWS cost savings
Discover cost savings
Unified view of AWS discounts
COGS and business metrics
Model savings plans
Collaborate on cost initiatives
Create and manage your teams
Automate cloud infrastructure
Cloud cost issue tracking
Detect cost spikes
by Emily Dunenfeld
Contents
Inactive VPNs, which are VPNs with both primary and secondary tunnels down, quietly accumulate costs while providing no operational value. Consider AWS Site-to-Site VPN: the cost is five cents an hour per VPN, totaling $36 monthly, or $432 annually. Still, for many large companies, this type of operational oversight is par for the course.
Even so, with multiple inactive VPNs, the costs can add up. Given an account with 100 inactive VPNs, that totals $3600 a month and a staggering annual cost of $43,200. Even if you’re not at that spending level, it may be worth it to take steps to routinely check the status of your VPNs.
For those unfamiliar with the structure of VPNs, they consist of primary and secondary tunnels. The primary tunnel is the main pathway for secure data transmission between two endpoints. The secondary tunnel provides continuous connectivity and acts as a failover mechanism.
When both tunnels fail, the VPN connection becomes inoperable, and data cannot securely flow between the two networks until the tunnels are restored. Failures happen for several reasons, such as network issues, misconfigurations, or problems at the VPN endpoints. Although you are no longer charged for active data transmission, with AWS Site-to-Site VPN you are still charged five cents an hour per VPN.
To avoid unnecessary charges for inactive VPNs you need to identify if you have an inactive VPN, then either fix or terminate that VPN. There are several options to check if the tunnels in your AWS Site-to-Site VPN are down. For other VPN services check the documentation for the corresponding steps.
DescribeVPNConnections
<vgwTelemetry> <item> <outsideIpAddress>203.0.113.3</outsideIpAddress> <status>DOWN</status> <lastStatusChange>2023-11-09T15:45:22.000Z</lastStatusChange> <statusMessage>Configuration mismatch: Phase 1 encryption algorithm does not match.</statusMessage> <acceptedRouteCount>0</acceptedRouteCount> </item> <item> <outsideIpAddress>203.0.113.5</outsideIpAddress> <status>DOWN</status> <lastStatusChange>2023-11-09T15:45:22.000Z</lastStatusChange> <statusMessage>No response from peer: Network connectivity issue</statusMessage> <acceptedRouteCount>0</acceptedRouteCount> </item> </vgwTelemetry>
Sample DescribeVPNConnections response
TunnelState
TunnelIKEPhase1State
TunnelIKEPhase2State
Taking these measures allows you to detect inactive VPNs, thereby preventing unnecessary charges and ensuring that your VPN infrastructure is both cost-effective and operationally sound.
After auditing existing VPNs for inactivity, consider these proactive steps moving forward:
aws cloudwatch put-metric-alarm \ --alarm-name BothTunnelsDownAlarm \ --alarm-description "Alert when both tunnels are down" \ --actions-enabled \ --alarm-actions <SNS_TOPIC_ARN> \ --metric-name TunnelState \ --namespace AWS/VPN \ --statistic Minimum \ --dimensions Name=Tunnel,Value=Tunnel1 \ --period 300 \ --threshold 0 \ --comparison-operator LessThanOrEqualToThreshold \ --evaluation-periods 1 \ --unit Count \ --alarm-name-suffix Tunnel1 \ --threshold-metric TunnelState:Tunnel2:Minimum:300
CloudWatch alarm to send a SNS message when both tunnels are down for more than 5 minutes
Monitoring and maintaining the health of your VPN infrastructure is crucial to avoid needless charges. Checking for inactive VPNs through API calls, the AWS Management Console, or connectivity tests can help in detecting inactive VPNs. Taking steps such as regular audits or proactive measures such as regular audits or implementing CloudWatch alerts can save you thousands of dollars. By following these guidelines, you can optimize costs, maintain a robust VPN infrastructure, and ensure seamless connectivity between networks.
RDS Extended Support allows customers to continue receiving security updates for older database versions, but it comes at a significant hourly per-vCPU cost that increases over time.
MongoDB Atlas is the cost-effective choice for production workloads where high-availability is a requirement.
Grafana is a strong competitor to the monitoring and observability features of Datadog for a fraction of the price.