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
with this construct, or
invalid reference
GatewayCredentialProvider.fromApiKeyIdentity
with
invalid reference
ApiKeyCredentialProvider.bindForGatewayApiKeyTarget
.
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forApiKeyCredentialProvider.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.bedrockagentcore.IApiKeyCredentialProvider
IApiKeyCredentialProvider.Jsii$Default, IApiKeyCredentialProvider.Jsii$ProxyNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedApiKeyCredentialProvider(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedApiKeyCredentialProvider(software.amazon.jsii.JsiiObjectRef objRef) ApiKeyCredentialProvider(software.constructs.Construct scope, String id) ApiKeyCredentialProvider(software.constructs.Construct scope, String id, ApiKeyCredentialProviderProps props) -
Method Summary
Modifier and TypeMethodDescriptionARNs for/invalid reference
GatewayCredentialProvider.fromApiKeyIdentity.invalid reference
GatewayCredentialProvider.fromApiKeyIdentityArnstatic IApiKeyCredentialProviderfromApiKeyCredentialProviderAttributes(software.constructs.Construct scope, String id, ApiKeyCredentialProviderAttributes attrs) Import an existing API key credential provider.The name of this API key credential provider.A reference to a ApiKeyCredentialProvider resource.The ARN of the Secrets Manager secret that stores the API key after the resource is created.Timestamp when the credential provider was created.The ARN of this credential provider.The principal to grant permissions to.Timestamp when the credential provider was last updated.grant(IGrantable grantee, String... actions) [disable-awslint:no-grants].grantAdmin(IGrantable grantee) [disable-awslint:no-grants].grantFullAccess(IGrantable grantee) [disable-awslint:no-grants].grantRead(IGrantable grantee) [disable-awslint:no-grants].grantUse(IGrantable grantee) [disable-awslint:no-grants].Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResource, withMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNode, withMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
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
-
fromApiKeyCredentialProviderAttributes
@Stability(Stable) @NotNull public static IApiKeyCredentialProvider fromApiKeyCredentialProviderAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ApiKeyCredentialProviderAttributes attrs) Import an existing API key credential provider.- Parameters:
scope- This parameter is required.id- This parameter is required.attrs- This parameter is required.
-
bindForGatewayApiKeyTarget
ARNs for/invalid reference
GatewayCredentialProvider.fromApiKeyIdentity.invalid reference
GatewayCredentialProvider.fromApiKeyIdentityArn- Specified by:
bindForGatewayApiKeyTargetin interfaceIApiKeyCredentialProvider
-
grant
@Stability(Stable) @NotNull public Grant grant(@NotNull IGrantable grantee, @NotNull String... actions) [disable-awslint:no-grants].- Specified by:
grantin interfaceIApiKeyCredentialProvider- Parameters:
grantee- This parameter is required.actions- This parameter is required.
-
grantAdmin
[disable-awslint:no-grants].- Specified by:
grantAdminin interfaceIApiKeyCredentialProvider- Parameters:
grantee- This parameter is required.
-
grantFullAccess
[disable-awslint:no-grants].- Specified by:
grantFullAccessin interfaceIApiKeyCredentialProvider- Parameters:
grantee- This parameter is required.
-
grantRead
[disable-awslint:no-grants].- Specified by:
grantReadin interfaceIApiKeyCredentialProvider- Parameters:
grantee- This parameter is required.
-
grantUse
[disable-awslint:no-grants].- Specified by:
grantUsein interfaceIApiKeyCredentialProvider- Parameters:
grantee- This parameter is required.
-
getApiKeyCredentialProviderName
The name of this API key credential provider. -
getApiKeyCredentialProviderRef
@Stability(Stable) @NotNull public ApiKeyCredentialProviderReference getApiKeyCredentialProviderRef()A reference to a ApiKeyCredentialProvider resource.- Specified by:
getApiKeyCredentialProviderRefin interfaceIApiKeyCredentialProviderRef
-
getCredentialProviderArn
The ARN of this credential provider.- Specified by:
getCredentialProviderArnin interfaceIApiKeyCredentialProvider
-
getGrantPrincipal
The principal to grant permissions to.- Specified by:
getGrantPrincipalin interfaceIGrantable
-
getApiKeySecretArn
The ARN of the Secrets Manager secret that stores the API key after the resource is created.May be undefined for resources imported without this attribute.
- Specified by:
getApiKeySecretArnin interfaceIApiKeyCredentialProvider
-
getCreatedTime
Timestamp when the credential provider was created.- Specified by:
getCreatedTimein interfaceIApiKeyCredentialProvider
-
getLastUpdatedTime
Timestamp when the credential provider was last updated.- Specified by:
getLastUpdatedTimein interfaceIApiKeyCredentialProvider
-