interface GatewayTargetOpenApiProps
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Bedrock.Agentcore.Alpha.GatewayTargetOpenApiProps |
Go | github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2#GatewayTargetOpenApiProps |
Java | software.amazon.awscdk.services.bedrock.agentcore.alpha.GatewayTargetOpenApiProps |
Python | aws_cdk.aws_bedrock_agentcore_alpha.GatewayTargetOpenApiProps |
TypeScript (source) | @aws-cdk/aws-bedrock-agentcore-alpha ยป GatewayTargetOpenApiProps |
Properties for creating an OpenAPI-based Gateway Target.
Example
const gateway = new agentcore.Gateway(this, "MyGateway", {
gatewayName: "my-gateway",
});
// outbound auth (Use AWS console to create it, Once Identity L2 construct is available you can use it to create identity)
const apiKeyIdentityArn = "arn:aws:bedrock-agentcore:us-east-1:123456789012:token-vault/abc123/apikeycredentialprovider/my-apikey"
const apiKeySecretArn = "arn:aws:secretsmanager:us-east-1:123456789012:secret:my-apikey-secret-abc123"
const opneapiSchema = agentcore.ApiSchema.fromLocalAsset(path.join(__dirname, "mySchema.yml"));
opneapiSchema.bind(this);
// Create a gateway target with OpenAPI Schema
const target = agentcore.GatewayTarget.forOpenApi(this, "MyTarget", {
gatewayTargetName: "my-api-target",
description: "Target for external API integration",
gateway: gateway, // Note: you need to pass the gateway reference
apiSchema: opneapiSchema,
credentialProviderConfigurations: [
agentcore.GatewayCredentialProvider.fromApiKeyIdentityArn({
providerArn: apiKeyIdentityArn,
secretArn: apiKeySecretArn
}),
],
});
Properties
| Name | Type | Description |
|---|---|---|
| api | Api | The OpenAPI schema defining the API. |
| gateway | IGateway | The gateway this target belongs to. |
| gateway | string | The name of the gateway target The name must be unique within the gateway Pattern: ^([0-9a-zA-Z][-]?){1,100}$. |
| credential | ICredential[] | Credential providers for authentication OpenAPI targets support API key and OAuth authentication (not IAM). |
| description? | string | Optional description for the gateway target The description can have up to 200 characters. |
| validate | boolean | Whether to validate the OpenAPI schema (only applies to inline schemas) Note: Validation is only performed for inline schemas during CDK synthesis. |
apiSchema
Type:
Api
The OpenAPI schema defining the API.
gateway
Type:
IGateway
The gateway this target belongs to.
gatewayTargetName
Type:
string
The name of the gateway target The name must be unique within the gateway Pattern: ^([0-9a-zA-Z][-]?){1,100}$.
credentialProviderConfigurations?
Type:
ICredential[]
(optional, default: : If not provided, defaults to IAM role which will fail at runtime)
Credential providers for authentication OpenAPI targets support API key and OAuth authentication (not IAM).
description?
Type:
string
(optional, default: No description)
Optional description for the gateway target The description can have up to 200 characters.
validateOpenApiSchema?
Type:
boolean
(optional, default: true)
Whether to validate the OpenAPI schema (only applies to inline schemas) Note: Validation is only performed for inline schemas during CDK synthesis.
S3 and asset-based schemas cannot be validated at synthesis time.

.NET
Go
Java
Python
TypeScript (