Class ApiGatewayTargetConfiguration

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.bedrockagentcore.McpTargetConfiguration
software.amazon.awscdk.services.bedrockagentcore.ApiGatewayTargetConfiguration
All Implemented Interfaces:
ITargetConfiguration, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.129.0 (build eaca441)", date="2026-05-19T08:18:44.214Z") @Stability(Stable) public class ApiGatewayTargetConfiguration extends McpTargetConfiguration
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

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.apigateway.*;
 import software.amazon.awscdk.services.bedrockagentcore.*;
 ApiGatewayHttpMethod apiGatewayHttpMethod;
 RestApi restApi;
 ApiGatewayTargetConfiguration apiGatewayTargetConfiguration = ApiGatewayTargetConfiguration.Builder.create()
         .apiGatewayToolConfiguration(ApiGatewayToolConfiguration.builder()
                 .toolFilters(List.of(ApiGatewayToolFilter.builder()
                         .filterPath("filterPath")
                         .methods(List.of(apiGatewayHttpMethod))
                         .build()))
                 // the properties below are optional
                 .toolOverrides(List.of(ApiGatewayToolOverride.builder()
                         .method(apiGatewayHttpMethod)
                         .name("name")
                         .path("path")
                         // the properties below are optional
                         .description("description")
                         .build()))
                 .build())
         .restApi(restApi)
         // the properties below are optional
         .metadataConfiguration(MetadataConfiguration.builder()
                 .allowedQueryParameters(List.of("allowedQueryParameters"))
                 .allowedRequestHeaders(List.of("allowedRequestHeaders"))
                 .allowedResponseHeaders(List.of("allowedResponseHeaders"))
                 .build())
         .stage("stage")
         .build();
 
  • Constructor Details

    • ApiGatewayTargetConfiguration

      protected ApiGatewayTargetConfiguration(software.amazon.jsii.JsiiObjectRef objRef)
    • ApiGatewayTargetConfiguration

      protected ApiGatewayTargetConfiguration(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • ApiGatewayTargetConfiguration

      @Stability(Stable) public ApiGatewayTargetConfiguration(@NotNull ApiGatewayTargetConfigurationProps props)
      Parameters:
      props - This parameter is required.
  • Method Details

    • create

      @Stability(Stable) @NotNull public static ApiGatewayTargetConfiguration create(@NotNull ApiGatewayTargetConfigurationProps props)
      Create an API Gateway target configuration.

      Parameters:
      props - The configuration properties. This parameter is required.
      Returns:
      A new ApiGatewayTargetConfiguration instance
    • bind

      @Stability(Stable) @NotNull public TargetConfigurationConfig bind(@NotNull software.constructs.Construct _scope, @NotNull IGateway gateway)
      Binds this configuration to a construct scope Sets up necessary permissions for the gateway to access the API Gateway.

      Specified by:
      bind in interface ITargetConfiguration
      Specified by:
      bind in class McpTargetConfiguration
      Parameters:
      _scope - The construct scope. This parameter is required.
      gateway - The gateway that will use this target. This parameter is required.
    • renderMcpConfiguration

      @Stability(Stable) @NotNull protected Object renderMcpConfiguration()
      Renders the MCP-specific configuration.
      Specified by:
      renderMcpConfiguration in class McpTargetConfiguration
    • getApiGatewayToolConfiguration

      @Stability(Stable) @NotNull public ApiGatewayToolConfiguration getApiGatewayToolConfiguration()
      Tool configuration for the API Gateway target.
    • getRestApiId

      @Stability(Stable) @NotNull public String getRestApiId()
      The ID of the REST API.
    • getStage

      @Stability(Stable) @NotNull public String getStage()
      The stage name of the REST API.
    • getTargetType

      @Stability(Stable) @NotNull public McpTargetType getTargetType()
      The target type.
      Specified by:
      getTargetType in interface ITargetConfiguration
      Specified by:
      getTargetType in class McpTargetConfiguration
    • getMetadataConfiguration

      @Stability(Stable) @Nullable public MetadataConfiguration getMetadataConfiguration()
      Metadata configuration for the API Gateway target.