Class: AWSCDK::BedrockAgentCore::APIGatewayTargetConfiguration

Inherits:
McpTargetConfiguration
  • Object
show all
Defined in:
bedrock_agent_core/api_gateway_target_configuration.rb

Overview

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(props) ⇒ APIGatewayTargetConfiguration

Returns a new instance of APIGatewayTargetConfiguration.



21
22
23
24
25
# File 'bedrock_agent_core/api_gateway_target_configuration.rb', line 21

def initialize(props)
  props = props.is_a?(Hash) ? ::AWSCDK::BedrockAgentCore::APIGatewayTargetConfigurationProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9ja2FnZW50Y29yZS5BcGlHYXRld2F5VGFyZ2V0Q29uZmlndXJhdGlvblByb3BzIn0=")), "props")
  Jsii::Object.instance_method(:initialize).bind(self).call(props)
end

Class Method Details

.create(props) ⇒ AWSCDK::BedrockAgentCore::APIGatewayTargetConfiguration

Create an API Gateway target configuration.

Parameters:

Returns:

  • (AWSCDK::BedrockAgentCore::APIGatewayTargetConfiguration)

    A new ApiGatewayTargetConfiguration instance



43
44
45
46
47
# File 'bedrock_agent_core/api_gateway_target_configuration.rb', line 43

def self.create(props)
  props = props.is_a?(Hash) ? ::AWSCDK::BedrockAgentCore::APIGatewayTargetConfigurationProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9ja2FnZW50Y29yZS5BcGlHYXRld2F5VGFyZ2V0Q29uZmlndXJhdGlvblByb3BzIn0=")), "props")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_bedrockagentcore.ApiGatewayTargetConfiguration", "create", [props])
end

.jsii_overridable_methodsObject



27
28
29
30
31
32
33
34
35
36
37
# File 'bedrock_agent_core/api_gateway_target_configuration.rb', line 27

def self.jsii_overridable_methods
  {
    :target_type => { kind: :property, name: "targetType", is_optional: false },
    :api_gateway_tool_configuration => { kind: :property, name: "apiGatewayToolConfiguration", is_optional: false },
    :rest_api_id => { kind: :property, name: "restApiId", is_optional: false },
    :stage => { kind: :property, name: "stage", is_optional: false },
    :metadata_configuration => { kind: :property, name: "metadataConfiguration", is_optional: true },
    :bind => { kind: :method, name: "bind", is_optional: false },
    :render_mcp_configuration => { kind: :method, name: "renderMcpConfiguration", is_optional: false },
  }
end

Instance Method Details

#api_gateway_tool_configurationAWSCDK::BedrockAgentCore::APIGatewayToolConfiguration

Tool configuration for the API Gateway target.



59
60
61
# File 'bedrock_agent_core/api_gateway_target_configuration.rb', line 59

def api_gateway_tool_configuration()
  jsii_get_property("apiGatewayToolConfiguration")
end

#bind(_scope, gateway) ⇒ AWSCDK::BedrockAgentCore::TargetConfigurationConfig

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

Parameters:

Returns:



89
90
91
92
93
# File 'bedrock_agent_core/api_gateway_target_configuration.rb', line 89

def bind(_scope, gateway)
  Jsii::Type.check_type(_scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "_scope")
  Jsii::Type.check_type(gateway, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9ja2FnZW50Y29yZS5JR2F0ZXdheSJ9")), "gateway")
  jsii_call_method("bind", [_scope, gateway])
end

#metadata_configurationAWSCDK::BedrockAgentCore::MetadataConfiguration?

Metadata configuration for the API Gateway target.



80
81
82
# File 'bedrock_agent_core/api_gateway_target_configuration.rb', line 80

def ()
  jsii_get_property("metadataConfiguration")
end

#render_mcp_configurationObject

Renders the MCP-specific configuration.

Returns:

  • (Object)


98
99
100
# File 'bedrock_agent_core/api_gateway_target_configuration.rb', line 98

def render_mcp_configuration()
  jsii_call_method("renderMcpConfiguration", [])
end

#rest_api_idString

The ID of the REST API.

Returns:

  • (String)


66
67
68
# File 'bedrock_agent_core/api_gateway_target_configuration.rb', line 66

def rest_api_id()
  jsii_get_property("restApiId")
end

#stageString

The stage name of the REST API.

Returns:

  • (String)


73
74
75
# File 'bedrock_agent_core/api_gateway_target_configuration.rb', line 73

def stage()
  jsii_get_property("stage")
end

#target_typeAWSCDK::BedrockAgentCore::McpTargetType

The target type.



52
53
54
# File 'bedrock_agent_core/api_gateway_target_configuration.rb', line 52

def target_type()
  jsii_get_property("targetType")
end