1 Answer
- Newest
- Most votes
- Most comments
1
To resolve the issue of instances in VPC B not being able to resolve the execute-api.eu-central-1.amazonaws.com domain, you can use Route 53 Resolver endpoints in a specific way:
- Create an Outbound Resolver Endpoint in VPC B: This allows DNS queries originating from instances within VPC B to be resolved externally. You will need to specify the VPC and the subnets within VPC B where the endpoint will be located, and also define the security group rules to control the traffic.
- Create Resolver Rules for Forwarding DNS Queries: Create a Resolver rule that specifies the domain name for the API Gateway endpoint (execute-api.eu-central-1.amazonaws.com) and configures it to forward queries to the Amazon-provided DNS servers (usually reachable at the base of the VPC IP range plus two; for example, if your VPC's IP range is 10.0.0.0/16, the Amazon DNS is at 10.0.0.2). This rule should be associated with the outbound Resolver endpoint in VPC B.
- Associate the Resolver Rule with VPC B: Ensure that the created Resolver rule is associated with VPC B so that DNS queries from this VPC for the specified domain are forwarded according to the rule.
- Update Route 53 Resolver DNS Settings in VPC B if Necessary: Ensure that the DNS settings for VPC B are configured to use the Route 53 Resolver (this is usually the default setting for new VPCs but should be verified).
This setup allows instances in VPC B to resolve the API Gateway endpoint by forwarding their DNS queries through the Route 53 Resolver outbound endpoint to the external DNS servers that can resolve the API Gateway domain name. Here's a complete demo, including Terraform code demonstrating how to solve this problem: VPC Endpoint Cross Region Access using Terraform.

Hi Andrei,
Thanks for the detailed breakdown.
My errors were on points 2 and 3. So to resolve the DNS for the private API Gateway endpoint in VPC B, I did the following;
aws_route53_resolver_rule_associationresource to associate the resolver rule with VPC BThanks again.