ApiGatewayTargetConfiguration

class aws_cdk.aws_bedrock_agentcore_alpha.ApiGatewayTargetConfiguration(*, api_gateway_tool_configuration, rest_api, metadata_configuration=None, stage=None)

Bases: McpTargetConfiguration

(experimental) Configuration for API Gateway-based MCP targets.

This configuration connects your gateway to an Amazon API Gateway REST API stage. The gateway translates incoming MCP requests into HTTP requests to your REST API and handles response formatting.

Key considerations:

  • API must be in the same account and region as the gateway

  • Only REST APIs are supported (no HTTP or WebSocket APIs)

  • API must use a public endpoint type

  • Methods with both AWS_IAM authorization and API key requirements are not supported

  • Proxy resources (e.g., /pets/{proxy+}) are not supported

Stability:

experimental

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_bedrock_agentcore_alpha as bedrock_agentcore_alpha
from aws_cdk import aws_apigateway as apigateway

# rest_api: apigateway.RestApi

api_gateway_target_configuration = bedrock_agentcore_alpha.ApiGatewayTargetConfiguration(
    api_gateway_tool_configuration=bedrock_agentcore_alpha.ApiGatewayToolConfiguration(
        tool_filters=[bedrock_agentcore_alpha.ApiGatewayToolFilter(
            filter_path="filterPath",
            methods=[bedrock_agentcore_alpha.ApiGatewayHttpMethod.GET]
        )],

        # the properties below are optional
        tool_overrides=[bedrock_agentcore_alpha.ApiGatewayToolOverride(
            method=bedrock_agentcore_alpha.ApiGatewayHttpMethod.GET,
            name="name",
            path="path",

            # the properties below are optional
            description="description"
        )]
    ),
    rest_api=rest_api,

    # the properties below are optional
    metadata_configuration=bedrock_agentcore_alpha.MetadataConfiguration(
        allowed_query_parameters=["allowedQueryParameters"],
        allowed_request_headers=["allowedRequestHeaders"],
        allowed_response_headers=["allowedResponseHeaders"]
    ),
    stage="stage"
)
Parameters:
  • api_gateway_tool_configuration (Union[ApiGatewayToolConfiguration, Dict[str, Any]]) – (experimental) Tool configuration defining which operations to expose.

  • rest_api (IRestApi) – (experimental) The REST API to integrate with Must be in the same account and region as the gateway.

  • metadata_configuration (Union[MetadataConfiguration, Dict[str, Any], None]) – (experimental) Metadata configuration for passing headers and query parameters Allows you to pass additional context through headers and query parameters. Default: - No metadata configuration

  • stage (Optional[str]) – (experimental) The stage name of the REST API. Default: - Uses the deployment stage from the RestApi (restApi.deploymentStage.stageName)

Stability:

experimental

Methods

bind(_scope, gateway)

(experimental) Binds this configuration to a construct scope Sets up necessary permissions for the gateway to access the API Gateway.

Parameters:
  • _scope (Construct) – The construct scope.

  • gateway (IGateway) – The gateway that will use this target.

Stability:

experimental

Return type:

TargetConfigurationConfig

Attributes

api_gateway_tool_configuration

(experimental) Tool configuration for the API Gateway target.

Stability:

experimental

metadata_configuration

(experimental) Metadata configuration for the API Gateway target.

Stability:

experimental

rest_api_id

(experimental) The ID of the REST API.

Stability:

experimental

stage

(experimental) The stage name of the REST API.

Stability:

experimental

target_type

(experimental) The target type.

Stability:

experimental

Static Methods

classmethod create(*, api_gateway_tool_configuration, rest_api, metadata_configuration=None, stage=None)

(experimental) Create an API Gateway target configuration.

Parameters:
  • api_gateway_tool_configuration (Union[ApiGatewayToolConfiguration, Dict[str, Any]]) – (experimental) Tool configuration defining which operations to expose.

  • rest_api (IRestApi) – (experimental) The REST API to integrate with Must be in the same account and region as the gateway.

  • metadata_configuration (Union[MetadataConfiguration, Dict[str, Any], None]) – (experimental) Metadata configuration for passing headers and query parameters Allows you to pass additional context through headers and query parameters. Default: - No metadata configuration

  • stage (Optional[str]) – (experimental) The stage name of the REST API. Default: - Uses the deployment stage from the RestApi (restApi.deploymentStage.stageName)

Return type:

ApiGatewayTargetConfiguration

Returns:

A new ApiGatewayTargetConfiguration instance

Stability:

experimental