interface FromApiKeyIdentityOptions
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Bedrock.Agentcore.Alpha.FromApiKeyIdentityOptions |
Go | github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2#FromApiKeyIdentityOptions |
Java | software.amazon.awscdk.services.bedrock.agentcore.alpha.FromApiKeyIdentityOptions |
Python | aws_cdk.aws_bedrock_agentcore_alpha.FromApiKeyIdentityOptions |
TypeScript (source) | @aws-cdk/aws-bedrock-agentcore-alpha ยป FromApiKeyIdentityOptions |
Optional gateway settings when binding an {@link IApiKeyCredentialProvider} to a target.
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 | Api | Where to place the API key on outbound requests. |
credentialLocation?
Type:
Api
(optional, default: header Authorization with Bearer prefix)
Where to place the API key on outbound requests.

.NET
Go
Java
Python
TypeScript (