Class ApiKeyCredentialProvider

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.bedrockagentcore.ApiKeyCredentialProvider
All Implemented Interfaces:
IApiKeyCredentialProviderRef, IEnvironmentAware, IResource, IApiKeyCredentialProvider, IGrantable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.129.0 (build eaca441)", date="2026-05-19T08:18:44.218Z") @Stability(Stable) public class ApiKeyCredentialProvider extends Resource implements IApiKeyCredentialProvider
L2 construct for AWS::BedrockAgentCore::ApiKeyCredentialProvider.

Use this to register an API key identity in AgentCore Token Vault. To attach the identity to a gateway target, use

invalid reference
GatewayCredentialProvider.fromApiKeyIdentity
with this construct, or
invalid reference
ApiKeyCredentialProvider.bindForGatewayApiKeyTarget
with
invalid reference
GatewayCredentialProvider.fromApiKeyIdentityArn
.

Example:

 Gateway gateway = Gateway.Builder.create(this, "MyGateway")
         .gatewayName("my-gateway")
         .build();
 // Create an API key credential provider in Token Vault
 ApiKeyCredentialProvider apiKeyProvider = ApiKeyCredentialProvider.Builder.create(this, "MyApiKeyProvider")
         .apiKeyCredentialProviderName("my-apikey")
         .build();
 IBucket bucket = Bucket.fromBucketName(this, "ExistingBucket", "my-schema-bucket");
 S3ApiSchema s3mySchema = ApiSchema.fromS3File(bucket, "schemas/myschema.yaml");
 // Add an OpenAPI target using the L2 construct directly
 GatewayTarget target = gateway.addOpenApiTarget("MyTarget", AddOpenApiTargetOptions.builder()
         .gatewayTargetName("my-api-target")
         .description("Target for external API integration")
         .apiSchema(s3mySchema)
         .credentialProviderConfigurations(List.of(GatewayCredentialProvider.fromApiKeyIdentity(apiKeyProvider, FromApiKeyIdentityOptions.builder()
                 .credentialLocation(ApiKeyCredentialLocation.header(ApiKeyAdditionalConfiguration.builder()
                         .credentialParameterName("X-API-Key")
                         .build()))
                 .build())))
         .build());
 // This makes sure your s3 bucket is available before target
 target.node.addDependency(bucket);
 

See Also:
  • Field Details

    • PROPERTY_INJECTION_ID

      @Stability(Stable) public static final String PROPERTY_INJECTION_ID
      Uniquely identifies this class.
  • Constructor Details

    • ApiKeyCredentialProvider

      protected ApiKeyCredentialProvider(software.amazon.jsii.JsiiObjectRef objRef)
    • ApiKeyCredentialProvider

      protected ApiKeyCredentialProvider(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • ApiKeyCredentialProvider

      @Stability(Stable) public ApiKeyCredentialProvider(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable ApiKeyCredentialProviderProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props -
    • ApiKeyCredentialProvider

      @Stability(Stable) public ApiKeyCredentialProvider(@NotNull software.constructs.Construct scope, @NotNull String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
  • Method Details