ApiGatewayTargetConfigurationProps Struct
Properties for creating an API Gateway target configuration.
| Source | aws-bedrockagentcore/lib/gateway/targets/target-configuration.ts |
|---|---|
| Type last changed |
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_apigateway as apigateway } from 'aws-cdk-lib';
import { aws_bedrockagentcore as bedrockagentcore } from 'aws-cdk-lib';
declare const apiGatewayHttpMethod: bedrockagentcore.ApiGatewayHttpMethod;
declare const restApi: apigateway.RestApi;
const apiGatewayTargetConfigurationProps: bedrockagentcore.ApiGatewayTargetConfigurationProps = {
apiGatewayToolConfiguration: {
toolFilters: [{
filterPath: 'filterPath',
methods: [apiGatewayHttpMethod],
}],
// the properties below are optional
toolOverrides: [{
method: apiGatewayHttpMethod,
name: 'name',
path: 'path',
// the properties below are optional
description: 'description',
}],
},
restApi: restApi,
// the properties below are optional
metadataConfiguration: {
allowedQueryParameters: ['allowedQueryParameters'],
allowedRequestHeaders: ['allowedRequestHeaders'],
allowedResponseHeaders: ['allowedResponseHeaders'],
},
stage: 'stage',
};
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_apigateway as apigateway
from aws_cdk import aws_bedrockagentcore as bedrockagentcore
# api_gateway_http_method: bedrockagentcore.ApiGatewayHttpMethod
# rest_api: apigateway.RestApi
api_gateway_target_configuration_props = bedrockagentcore.ApiGatewayTargetConfigurationProps(
api_gateway_tool_configuration=bedrockagentcore.ApiGatewayToolConfiguration(
tool_filters=[bedrockagentcore.ApiGatewayToolFilter(
filter_path="filterPath",
methods=[api_gateway_http_method]
)],
# the properties below are optional
tool_overrides=[bedrockagentcore.ApiGatewayToolOverride(
method=api_gateway_http_method,
name="name",
path="path",
# the properties below are optional
description="description"
)]
),
rest_api=rest_api,
# the properties below are optional
metadata_configuration=bedrockagentcore.MetadataConfiguration(
allowed_query_parameters=["allowedQueryParameters"],
allowed_request_headers=["allowedRequestHeaders"],
allowed_response_headers=["allowedResponseHeaders"]
),
stage="stage"
)
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.apigateway.*;
import software.amazon.awscdk.services.bedrockagentcore.*;
ApiGatewayHttpMethod apiGatewayHttpMethod;
RestApi restApi;
ApiGatewayTargetConfigurationProps apiGatewayTargetConfigurationProps = ApiGatewayTargetConfigurationProps.builder()
.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();
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.APIGateway;
using Amazon.CDK.AWS.BedrockAgentCore;
ApiGatewayHttpMethod apiGatewayHttpMethod;
RestApi restApi;
var apiGatewayTargetConfigurationProps = new ApiGatewayTargetConfigurationProps {
ApiGatewayToolConfiguration = new ApiGatewayToolConfiguration {
ToolFilters = new [] { new ApiGatewayToolFilter {
FilterPath = "filterPath",
Methods = new [] { apiGatewayHttpMethod }
} },
// the properties below are optional
ToolOverrides = new [] { new ApiGatewayToolOverride {
Method = apiGatewayHttpMethod,
Name = "name",
Path = "path",
// the properties below are optional
Description = "description"
} }
},
RestApi = restApi,
// the properties below are optional
MetadataConfiguration = new MetadataConfiguration {
AllowedQueryParameters = new [] { "allowedQueryParameters" },
AllowedRequestHeaders = new [] { "allowedRequestHeaders" },
AllowedResponseHeaders = new [] { "allowedResponseHeaders" }
},
Stage = "stage"
};
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"
import "github.com/aws/aws-cdk-go/awscdk"
var apiGatewayHttpMethod ApiGatewayHttpMethod
var restApi RestApi
apiGatewayTargetConfigurationProps := &ApiGatewayTargetConfigurationProps{
ApiGatewayToolConfiguration: &ApiGatewayToolConfiguration{
ToolFilters: []ApiGatewayToolFilter{
&ApiGatewayToolFilter{
FilterPath: jsii.String("filterPath"),
Methods: []ApiGatewayHttpMethod{
apiGatewayHttpMethod,
},
},
},
// the properties below are optional
ToolOverrides: []ApiGatewayToolOverride{
&ApiGatewayToolOverride{
Method: apiGatewayHttpMethod,
Name: jsii.String("name"),
Path: jsii.String("path"),
// the properties below are optional
Description: jsii.String("description"),
},
},
},
RestApi: restApi,
// the properties below are optional
MetadataConfiguration: &MetadataConfiguration{
AllowedQueryParameters: []*string{
jsii.String("allowedQueryParameters"),
},
AllowedRequestHeaders: []*string{
jsii.String("allowedRequestHeaders"),
},
AllowedResponseHeaders: []*string{
jsii.String("allowedResponseHeaders"),
},
},
Stage: jsii.String("stage"),
}
Properties
apiGatewayToolConfigurationApiGatewayToolConfigurationapi_gateway_tool_configurationApiGatewayToolConfigurationapiGatewayToolConfigurationApiGatewayToolConfigurationApiGatewayToolConfigurationApiGatewayToolConfigurationApiGatewayToolConfigurationApiGatewayToolConfiguration required #Tool configuration defining which operations to expose.
metadataConfigurationoptionalMetadataConfigurationmetadata_configurationoptionalMetadataConfigurationmetadataConfigurationoptionalMetadataConfigurationMetadataConfigurationoptionalMetadataConfigurationMetadataConfigurationoptionalMetadataConfiguration #Metadata configuration for passing headers and query parameters Allows you to pass additional context through headers and query parameters.
Default: No metadata configuration
The REST API to integrate with Must be in the same account and region as the gateway.
The stage name of the REST API.
Default: Uses the deployment stage from the RestApi (restApi.deploymentStage.stageName)