interface ApiKeyAdditionalConfiguration
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Bedrock.Agentcore.Alpha.ApiKeyAdditionalConfiguration |
Go | github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2#ApiKeyAdditionalConfiguration |
Java | software.amazon.awscdk.services.bedrock.agentcore.alpha.ApiKeyAdditionalConfiguration |
Python | aws_cdk.aws_bedrock_agentcore_alpha.ApiKeyAdditionalConfiguration |
TypeScript (source) | @aws-cdk/aws-bedrock-agentcore-alpha ยป ApiKeyAdditionalConfiguration |
API Key additional configuration.
Example
const gateway = new agentcore.Gateway(this, "MyGateway", {
gatewayName: "my-gateway",
});
// These ARNs are returned when creating the API key credential provider via Console or API
const apiKeyProviderArn = "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 bucket = s3.Bucket.fromBucketName(this, "ExistingBucket", "my-schema-bucket");
const s3mySchema = agentcore.ApiSchema.fromS3File(bucket, "schemas/myschema.yaml");
// Add an OpenAPI target directly to the gateway
const target = gateway.addOpenApiTarget("MyTarget", {
gatewayTargetName: "my-api-target",
description: "Target for external API integration",
apiSchema: s3mySchema,
credentialProviderConfigurations: [
agentcore.GatewayCredentialProvider.fromApiKeyIdentityArn({
providerArn: apiKeyProviderArn,
secretArn: apiKeySecretArn,
credentialLocation: agentcore.ApiKeyCredentialLocation.header({
credentialParameterName: "X-API-Key",
}),
}),
],
});
// This make 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 (