interface ApiKeyAdditionalConfiguration
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.BedrockAgentCore.ApiKeyAdditionalConfiguration |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsbedrockagentcore#ApiKeyAdditionalConfiguration |
Java | software.amazon.awscdk.services.bedrockagentcore.ApiKeyAdditionalConfiguration |
Python | aws_cdk.aws_bedrockagentcore.ApiKeyAdditionalConfiguration |
TypeScript (source) | aws-cdk-lib » aws_bedrockagentcore » ApiKeyAdditionalConfiguration |
API Key additional configuration.
Example
const gateway = new agentcore.Gateway(this, "MyGateway", {
gatewayName: "my-gateway",
});
// Create an API key credential provider in Token Vault
const apiKeyProvider = new agentcore.ApiKeyCredentialProvider(this, "MyApiKeyProvider", {
apiKeyCredentialProviderName: "my-apikey",
});
const bucket = s3.Bucket.fromBucketName(this, "ExistingBucket", "my-schema-bucket");
const s3mySchema = agentcore.ApiSchema.fromS3File(bucket, "schemas/myschema.yaml");
// Add an OpenAPI target using the L2 construct directly
const target = gateway.addOpenApiTarget("MyTarget", {
gatewayTargetName: "my-api-target",
description: "Target for external API integration",
apiSchema: s3mySchema,
credentialProviderConfigurations: [
agentcore.GatewayCredentialProvider.fromApiKeyIdentity(apiKeyProvider, {
credentialLocation: agentcore.ApiKeyCredentialLocation.header({
credentialParameterName: "X-API-Key",
}),
}),
],
});
// This makes sure your s3 bucket is available before target
target.node.addDependency(bucket);
Properties
| Name | Type | Description |
|---|---|---|
| credential | string | The name of the credential parameter for the API key. |
| credential | string | The prefix for the API key credential. |
credentialParameterName?
Type:
string
(optional, default: 'Authorization' for HEADER, 'api_key' for QUERY_PARAMETER)
The name of the credential parameter for the API key.
This parameter name is used when sending the API key to the target endpoint.
Length Constraints: Minimum length of 1. Maximum length of 64.
credentialPrefix?
Type:
string
(optional, default: 'Bearer ' for HEADER, no prefix for QUERY_PARAMETER)
The prefix for the API key credential.
This prefix is added to the API key when sending it to the target endpoint.
Length Constraints: Minimum length of 1. Maximum length of 64.

.NET
Go
Java
Python
TypeScript (