How I Tackled Unexpected AWS Route 53 Resolver Costs
Are you getting unexpected AWS charges for Route 53 Resolver? The costs can quickly become worrisome, especially if you're not actively using the service. As someone managing an AWS account, cost optimization was my primary goal for this project, and I leaned on several AWS tools to help with this analysis.
Tools I Used:
- AWS Compute Optimizer
- Billing Dashboard
- Cost Explorer
- Savings Plan
- Reserved Instances
Identifying the Problem
While analyzing costs using Cost Explorer, I noticed a line item labeled EU-ResolverNetworkInterface. At first, I couldn't figure out where this cost was coming from. After thoroughly exploring AWS Route 53 via the console, I found no visible resolver endpoints, and searching the web didn’t offer any direct solutions. Ultimately, I realized that resolving this issue would require the AWS CLI.
What is AWS Route 53 Resolver?
Amazon Route 53 Resolver is a DNS service that enables you to manage and route DNS queries between your VPCs, on-premises networks, and the internet. If you have workloads spanning both AWS VPCs and on-premises resources, you'll likely need to resolve DNS records hosted in both environments.
Route 53 Resolver supports this by providing:
- Inbound Resolver Endpoints: Allow DNS queries to your VPC from on-premises or another VPC.
- Outbound Resolver Endpoints: Allow DNS queries from your VPC to on-premises resources or another VPC.
Additionally, Resolver rules enable you to create forwarding rules for specific domain names, specifying where to route DNS queries. These rules can be applied to individual VPCs and shared across multiple AWS accounts.
How I Resolved the Issue
Once I identified the cost was related to a Resolver in the EU region, I followed these steps to resolve it:
- List the Resolver Endpoints: First, I ran the following CLI command to check for existing resolver endpoints in the EU West (eu-west-1) region:
aws route53resolver list-resolver-endpoints --region eu-west-1
This showed that a resolver endpoint existed.
- List Resolver Rule Associations: Next, I checked the resolver rule associations to see where the rules were applied:
aws route53resolver list-resolver-rule-associations --region eu-west-1
This revealed the associated rule and the linked VPC.
- Disassociate the Resolver Rule: To unlink the resolver rule from the VPC, I ran the following command:
aws route53resolver disassociate-resolver-rule --vpc-id <vpc-id> --resolver-rule-id rslvr-rr-33c7383d12cb43919 --region eu-west-1
- Delete the Resolver Rule: Once the rule was disassociated, I proceeded to delete it:
aws route53resolver delete-resolver-rule --resolver-rule-id rslvr-rr-33c7383d12cb43919 --region eu-west-1
- Delete the Resolver Endpoint: Finally, I deleted the resolver endpoint using the following command:
aws route53resolver delete-resolver-endpoint --resolver-endpoint-id <resolver-endpoint-id> --region eu-west-1
- Double Check: I ran the list-resolver-endpoints command again to ensure no resolver endpoints remained. If any were still there, I repeated the process.
Conclusion
In my case, it was an Outbound Resolver Endpoint causing the issue. Following the steps above helped me clear the associated costs. If you’re seeing similar charges, don’t hesitate to follow these steps and clean up unused resolver endpoints or rules.
Good luck with your AWS cost optimization!
Top comments (0)