- Newest
- Most votes
- Most comments
To achieve the cross-account, cross-region private integration you're looking for between API Gateway in Account A and Route53 private route in Account B, you have a few options:
- Using VPC Link with HTTP API: Instead of using a REST API, you can use an HTTP API in Account A. HTTP APIs support VPC Links that can connect to ALB, NLB, or AWS Cloud Map. You can create a VPC Link in Account A that points to the ALB in Account B. This approach allows you to leverage the existing Route53 setup in Account B.
Steps:
- Create an HTTP API in Account A
- Set up a VPC Link in Account A, pointing to the ALB in Account B
- Configure the integration in the HTTP API to use this VPC Link
- Ensure proper routing and security group settings are in place
- Using PrivateLink: You can use AWS PrivateLink to expose the private API in Account B to Account A. This method allows you to keep your API Gateway private while still allowing cross-account access.
Steps:
- Create a VPC Endpoint Service in Account B for your API
- Create a corresponding VPC Endpoint in Account A
- Update the API Gateway resource policy in Account B to allow access from the VPC Endpoint in Account A
- Configure DNS resolution to properly resolve the API Gateway endpoint across the VPC peering connection
- Using Transit Gateway: Since you mentioned you already have a Transit Gateway (TGW) set up, you can leverage this for routing traffic between accounts.
Steps:
- Ensure the TGW is properly configured to route traffic between Account A and B
- Set up a VPC Link in Account A that points to the ALB in Account B through the TGW
- Configure the API Gateway in Account A to use this VPC Link
For all these approaches, make sure to:
- Configure proper IAM permissions to allow cross-account access
- Set up appropriate security groups and network ACLs
- Enable DNS resolution and hostnames in both VPCs if not already enabled
Regarding your question about sending API Gateway traffic directly to the private DNS record in Account B: This is challenging because API Gateway needs to be able to resolve the DNS name. However, you might be able to achieve this by setting up a private hosted zone in Account A that mirrors the private DNS setup in Account B, and then using Route53 resolver rules to forward DNS queries to Account B's private hosted zone. This would allow API Gateway in Account A to resolve the private DNS names in Account B.
Remember to thoroughly test your setup and monitor for any latency or performance issues, as cross-region setups can sometimes introduce additional overhead.
Sources
Access to private api gateway REST between regions | AWS re:Post
HTTP API - Best Practices for Designing Amazon API Gateway Private APIs and Private Integration
Can we associate Centralize VPC endpoint (execute API) with Private Rest API gateway | AWS re:Post
Relevant content
- asked 3 years ago
- asked 4 months ago
