Enhancing Enterprise Data Interactions with AgentCore Gateway: New API Gateway Support
What’s New: API Gateway Support in AgentCore Gateway
Walkthrough: Setting Up API Gateway as a Target
Prerequisites for Integrating with AgentCore Gateway
Establishing Inbound and Outbound Authorization
Creating Your AgentCore Gateway
Configuring Your API Gateway Target
Credential Provider Configuration for API Gateway
Testing the Integration with the Strands Agent Framework
Observability: Monitoring API Gateway Interactions
Clean Up: Managing Your Resources Efficiently
Conclusion: Elevating Agentic Applications with AgentCore Gateway and API Gateway
About the Authors
Unlocking the Future: AgentCore Gateway Now Supports API Gateway
In today’s rapidly evolving tech landscape, organizations are increasingly exploring the possibilities of agentic applications. A key challenge they face is integrating enterprise data securely and efficiently when making invocation requests to large language models (LLMs). To help streamline these interactions and ensure they align with enterprise policies, many organizations are turning to the Model Context Protocol (MCP) specification. This blog post will explore the recent enhancements in AgentCore Gateway, specifically its support for API Gateway, to help businesses overcome these challenges.
What’s New: API Gateway Support in AgentCore Gateway
The recently updated AgentCore Gateway now supports API Gateway as a target, alongside existing target types like Lambda functions and OpenAPI schemas. This enhancement is significant for organizations that have built robust API ecosystems using AWS API Gateway, connecting various back-end applications seamlessly.
Previously, integrating existing APIs into the agentic context required additional work, including translating MCP requests into RESTful APIs. This could lead to challenges in maintaining security and observability. However, with the new integration of API Gateway into AgentCore Gateway, organizations can now easily expose both new and existing API endpoints to agentic applications using MCP.
Simplified Integration
This integration simplifies the process significantly. Rather than needing to export API Gateway APIs as OpenAPI specifications and import them into AgentCore Gateway, developers can now directly target API Gateway. By adding a new target type, API_GATEWAY, organizations can expose their existing REST APIs as MCP tools quickly and efficiently. This means both API owners and consumers can streamline workflows by leveraging the integration capabilities of AgentCore Gateway and API Gateway.
Built-in Security and Observability
A major benefit of this integration is the built-in security and observability features it brings. Both AgentCore Gateway and API Gateway have established integrations with AWS CloudWatch Logs, AWS CloudTrail, and AWS X-Ray, allowing developers to gain insights into their applications, monitor usage, and troubleshoot issues. This allows for holistic observability and enhanced security throughout the API request lifecycle.
Walkthrough: Setting Up API Gateway as a Target
To illustrate how to leverage these new functionalities, let’s walk through the process of setting up an existing REST API with API Gateway as a target for AgentCore Gateway.
Prerequisites
To get started, you will need:
- An AWS account with an existing REST API in API Gateway.
- An IAM role or user with permissions to create an AgentCore Gateway and set up an API Gateway target.
Steps to Create the Gateway
In this example, the setup will utilize Boto3, the AWS SDK for Python. Alternatively, you can also explore interactive examples provided on GitHub.
- Create an AgentCore Gateway
import boto3
gateway_client = boto3.client(‘bedrock-agentcore-control’)
auth_config = {
"customJWTAuthorizer": {
"allowedClients": [‘YourClientID’],
"discoveryUrl": "YourDiscoveryUrl"
}
}
create_response = gateway_client.create_gateway(
name="sample-ac-gateway",
roleArn=’YourIAMRoleARN’,
protocolType="MCP",
protocolConfiguration={‘mcp’: {‘supportedVersions’: [‘2025-03-26’], ‘searchType’: ‘SEMANTIC’}},
authorizerType="CUSTOM_JWT",
authorizerConfiguration=auth_config,
description=’AgentCore Gateway with API Gateway target’
)
gatewayID = create_response["gatewayId"]
gatewayURL = create_response["gatewayUrl"]
2. **Create an API Gateway Target**
Next, configure the API Gateway target with the necessary information, including tool filters and credential provider configurations:
```python
create_gateway_target_response = gateway_client.create_gateway_target(
name="api-gateway-target",
gatewayIdentifier=gatewayID,
targetConfiguration=[your_target_configuration],
credentialProviderConfigurations=[your_credential_provider_configuration]
)
Testing the Integration
Use the Strands Agent framework or any MCP-compatible agent to test the newly created gateway functionalities. You can list available tools, call specific APIs, and observe the responses, making it easy to validate the integration.
Observability and Monitoring
To effectively monitor your Gateway resource, enable application logs and tracing. This will provide detailed insights into tool calls executed by your agentic application, including parameters, responses, and any errors encountered. The detailed logs, combined with CloudWatch metrics, allow you to assess application performance and usage.
{
"resource_arn": "arn:aws:bedrock-agentcore:us-west-2::gateway/sample-ac-gateway",
"event_timestamp": 1763621922275,
"body": {
"isError": false,
"log": "Executing tool api-gateway-target-1___GetPetById from target",
"id": "3"
}
}
Conclusion: Embracing Agentic Applications
With the integration of Amazon API Gateway into AgentCore Gateway, organizations can now seamlessly bring their existing APIs into the agentic era. This allows for secure, efficient interactions between established infrastructure and modern intelligent agents. By adopting these advanced capabilities, enterprises can innovate while maintaining robust security and observability.
Visit our developer documentation for a deeper dive into these features and to get started with building your agentic applications today!
About the Authors
-
Sparsh Wadhwa: A Solutions Architect at AWS with a wealth of expertise in serverless, event-driven architectures, and generative AI.
-
Heeki Park: A Principal Solutions Architect dedicated to helping enterprises embrace cloud-native applications and AI technologies.
-
Dhawal Patel: A Principal Generative AI Tech lead with experience in agentic AI, deep learning, and distributed computing.
Unlock the potential of your existing APIs and connect seamlessly with intelligent agent applications!