Skip to content
v2.274.0

OpenApiTargetConfiguration Class ​

Configuration for OpenAPI-based MCP targets.

This configuration exposes an OpenAPI/REST API as MCP tools, allowing the gateway to transform API operations into tool calls.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_bedrockagentcore as bedrockagentcore } from 'aws-cdk-lib';

declare const apiSchema: bedrockagentcore.ApiSchema;
const openApiTargetConfiguration = new bedrockagentcore.OpenApiTargetConfiguration(apiSchema, /* all optional props */ false);
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_bedrockagentcore as bedrockagentcore

# api_schema: bedrockagentcore.ApiSchema

open_api_target_configuration = bedrockagentcore.OpenApiTargetConfiguration(api_schema, False)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.bedrockagentcore.*;

ApiSchema apiSchema;

OpenApiTargetConfiguration openApiTargetConfiguration = new OpenApiTargetConfiguration(apiSchema, false);
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.BedrockAgentCore;

ApiSchema apiSchema;

var openApiTargetConfiguration = new OpenApiTargetConfiguration(apiSchema, false);
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var apiSchema ApiSchema

openApiTargetConfiguration := awscdk.Aws_bedrockagentcore.NewOpenApiTargetConfiguration(apiSchema, jsii.Boolean(false))

Initializer ​

ts
new OpenApiTargetConfiguration(apiSchema: ApiSchema, validateSchema?: boolean)
python
OpenApiTargetConfiguration(api_schema: ApiSchema, validate_schema: typing.Optional[bool] = None)
java
new OpenApiTargetConfiguration(ApiSchema apiSchema, Boolean validateSchema)
csharp
new OpenApiTargetConfiguration(ApiSchema apiSchema, bool? validateSchema = null)
go
NewOpenApiTargetConfiguration(ApiSchema ApiSchema, ValidateSchema *bool)

Properties ​

apiSchemaApiSchemaapi_schemaApiSchemaapiSchemaApiSchemaApiSchemaApiSchemaApiSchemaApiSchemarequired#
The OpenAPI schema that defines the API.
targetTypeMcpTargetTypetarget_typeMcpTargetTypetargetTypeMcpTargetTypeTargetTypeMcpTargetTypeTargetTypeMcpTargetTyperequired#
The target type.

Methods ​

bind(scope: Construct, gateway: IGateway): TargetConfigurationConfigdef bind(self, scope: Construct, gateway: IGateway) -> TargetConfigurationConfigpublic TargetConfigurationConfig bind(Construct scope, IGateway gateway)public TargetConfigurationConfig Bind(Construct scope, IGateway gateway)func Bind(Scope Construct, Gateway IGateway) TargetConfigurationConfig#
Binds this configuration to a construct scope Sets up necessary permissions for the gateway to access the API schema.
2 parameters

Parameters

  • scopescopescopescopeScope — The construct scope.
  • gatewaygatewaygatewaygatewayGateway — The gateway that will use this target.
create(apiSchema: ApiSchema, validateSchema?: boolean): OpenApiTargetConfiguration // chainable@staticmethod def create(api_schema: ApiSchema, validate_schema: typing.Optional[bool] = None) -> OpenApiTargetConfigurationpublic static OpenApiTargetConfiguration create(ApiSchema apiSchema, Boolean validateSchema)public static OpenApiTargetConfiguration Create(ApiSchema apiSchema, bool? validateSchema = null)func Create(ApiSchema ApiSchema, ValidateSchema *bool) OpenApiTargetConfigurationstatic#
Create an OpenAPI target configuration.
2 parameters · returns

Parameters

  • apiSchemaapi_schemaapiSchemaapiSchemaApiSchema — The OpenAPI schema.
  • validateSchemavalidate_schemavalidateSchemavalidateSchemaValidateSchema — Whether to validate the OpenAPI schema (only applies to inline schemas).

Returns: A new OpenApiTargetConfiguration instance