Skip to content

Connect AWS AgentCore Bedrock Gateway Target to private apis within a VPC

0

Hi, I want to use the OpenAPI schema of a private API that we have deployed within a VPC and exposed through a private Application Load Balancer to configure a Bedrock Gateway Target. My question is, can I integrate this OpenAPI schema to easily convert it into an MCP tool using the Bedrock Gateway Target resource, even though the API is private? Or can this resource only be used with public OpenAPI schemas?

private meaning not accesible on the internet, and public meaning accesible through the internet. Sorry My main languange is not english.

2 Answers
0

Emanuel - yes the answer is incorrect. I've been struggling with this problem also. Most AI's, including AWS Q answer this question incorrectly. From what I can tell there are 3 ways to do this all 3 expose the endpoint in some fashion to the public internet.

  1. create an external facing ALB to the same target as your internal ALB. this totally defeats the purpose of the internal ALB (it exposes your API to the public net). I have found no way to secure this other then authentication - it is truely a public endpoint.
  2. Create an API Gateway using PrivateLink. Same exact problem as 1. this then exposes your API to the public internet, but like 1. you can add layers of authentication.
  3. Use a Lambda function with PrivateLink access. Like 1 & 2 - the lambda endpoint is exposed to the public internet, but requires AWS SIG4 authentication.

answered 6 months ago

-3

Yes, you can integrate a private API (not accessible from the internet) with Amazon Bedrock AgentCore Gateway using its OpenAPI schema.

Amazon Bedrock AgentCore Gateway can connect to your private APIs within a VPC through interface VPC endpoints. This allows you to keep your API communications within the AWS network backbone rather than traversing the public internet, enhancing security and potentially reducing latency.

To set this up:

  1. Create interface VPC endpoints to establish private connectivity between your VPC-hosted agents and the AgentCore Gateway.

  2. Configure your OpenAPI target in the Gateway by providing the OpenAPI specification (either inline or via S3) that describes your private API.

  3. Set up the appropriate credential provider for authentication. For a private API, you'll need to configure outbound authentication using either API Key or OAuth credentials that Gateway will use to access your OpenAPI target.

  4. Ensure proper network connectivity between the Gateway and your private API through the VPC endpoint.

This approach allows you to transform your private API into an MCP-compatible tool that agents can discover and use, while maintaining the security benefits of keeping the API private within your VPC. The Gateway handles the translation between MCP and REST formats, abstracting away the complexity of protocol-level integration.
Sources
Secure ingress connectivity to Amazon Bedrock AgentCore Gateway using interface VPC endpoints | Artificial Intelligence
Introducing Amazon Bedrock AgentCore Gateway: Transforming enterprise AI agent tool development | Artificial Intelligence
Add OpenAPI targets to your gateway - Amazon Bedrock AgentCore
Core concepts for Amazon Bedrock AgentCore Gateway - Amazon Bedrock AgentCore

answered 9 months ago

  • I don't think this answer my question, the problem I have is that I don't see any VPC configuration within the gateway resource, I do see the agent core runtime, however if I configured the vpc in the agent core runtime this will help for my gateway communication to the private api eventhough ?

  • Nonspecific answer, lacks specific details on "ensuring proper network connectivity"

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.