Class CfnKnowledgeBase
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.bedrock.CfnKnowledgeBase
- All Implemented Interfaces:
IInspectable,ITaggableV2,IKnowledgeBaseRef,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-29T11:15:33.681Z")
@Stability(Stable)
public class CfnKnowledgeBase
extends CfnResource
implements IInspectable, IKnowledgeBaseRef, ITaggableV2
Specifies a knowledge base as a resource in a top-level template. Minimally, you must specify the following properties:.
- Name – Specify a name for the knowledge base.
- RoleArn – Specify the Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the knowledge base. For more information, see Create a service role for Knowledge base for Amazon Bedrock .
- KnowledgeBaseConfiguration – Specify the embeddings configuration of the knowledge base. The following sub-properties are required:
- Type – Specify the value
VECTOR. - StorageConfiguration – Specify information about the vector store in which the data source is stored. The following sub-properties are required:
- Type – Specify the vector store service that you are using.
Redis Enterprise Cloud vector stores are currently unsupported in AWS CloudFormation .
For more information about using knowledge bases in Amazon Bedrock , see Knowledge base for Amazon Bedrock .
See the Properties section below for descriptions of both the required and optional properties.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.bedrock.*;
CfnKnowledgeBase cfnKnowledgeBase = CfnKnowledgeBase.Builder.create(this, "MyCfnKnowledgeBase")
.knowledgeBaseConfiguration(KnowledgeBaseConfigurationProperty.builder()
.type("type")
// the properties below are optional
.kendraKnowledgeBaseConfiguration(KendraKnowledgeBaseConfigurationProperty.builder()
.kendraIndexArn("kendraIndexArn")
.build())
.sqlKnowledgeBaseConfiguration(SqlKnowledgeBaseConfigurationProperty.builder()
.type("type")
// the properties below are optional
.redshiftConfiguration(RedshiftConfigurationProperty.builder()
.queryEngineConfiguration(RedshiftQueryEngineConfigurationProperty.builder()
.type("type")
// the properties below are optional
.provisionedConfiguration(RedshiftProvisionedConfigurationProperty.builder()
.authConfiguration(RedshiftProvisionedAuthConfigurationProperty.builder()
.type("type")
// the properties below are optional
.databaseUser("databaseUser")
.usernamePasswordSecretArn("usernamePasswordSecretArn")
.build())
.clusterIdentifier("clusterIdentifier")
.build())
.serverlessConfiguration(RedshiftServerlessConfigurationProperty.builder()
.authConfiguration(RedshiftServerlessAuthConfigurationProperty.builder()
.type("type")
// the properties below are optional
.usernamePasswordSecretArn("usernamePasswordSecretArn")
.build())
.workgroupArn("workgroupArn")
.build())
.build())
.storageConfigurations(List.of(RedshiftQueryEngineStorageConfigurationProperty.builder()
.type("type")
// the properties below are optional
.awsDataCatalogConfiguration(RedshiftQueryEngineAwsDataCatalogStorageConfigurationProperty.builder()
.tableNames(List.of("tableNames"))
.build())
.redshiftConfiguration(RedshiftQueryEngineRedshiftStorageConfigurationProperty.builder()
.databaseName("databaseName")
.build())
.build()))
// the properties below are optional
.queryGenerationConfiguration(QueryGenerationConfigurationProperty.builder()
.executionTimeoutSeconds(123)
.generationContext(QueryGenerationContextProperty.builder()
.curatedQueries(List.of(CuratedQueryProperty.builder()
.naturalLanguage("naturalLanguage")
.sql("sql")
.build()))
.tables(List.of(QueryGenerationTableProperty.builder()
.name("name")
// the properties below are optional
.columns(List.of(QueryGenerationColumnProperty.builder()
.description("description")
.inclusion("inclusion")
.name("name")
.build()))
.description("description")
.inclusion("inclusion")
.build()))
.build())
.build())
.build())
.build())
.vectorKnowledgeBaseConfiguration(VectorKnowledgeBaseConfigurationProperty.builder()
.embeddingModelArn("embeddingModelArn")
// the properties below are optional
.embeddingModelConfiguration(EmbeddingModelConfigurationProperty.builder()
.bedrockEmbeddingModelConfiguration(BedrockEmbeddingModelConfigurationProperty.builder()
.dimensions(123)
.embeddingDataType("embeddingDataType")
.build())
.build())
.supplementalDataStorageConfiguration(SupplementalDataStorageConfigurationProperty.builder()
.supplementalDataStorageLocations(List.of(SupplementalDataStorageLocationProperty.builder()
.supplementalDataStorageLocationType("supplementalDataStorageLocationType")
// the properties below are optional
.s3Location(S3LocationProperty.builder()
.uri("uri")
.build())
.build()))
.build())
.build())
.build())
.name("name")
.roleArn("roleArn")
// the properties below are optional
.description("description")
.storageConfiguration(StorageConfigurationProperty.builder()
.type("type")
// the properties below are optional
.mongoDbAtlasConfiguration(MongoDbAtlasConfigurationProperty.builder()
.collectionName("collectionName")
.credentialsSecretArn("credentialsSecretArn")
.databaseName("databaseName")
.endpoint("endpoint")
.fieldMapping(MongoDbAtlasFieldMappingProperty.builder()
.metadataField("metadataField")
.textField("textField")
.vectorField("vectorField")
.build())
.vectorIndexName("vectorIndexName")
// the properties below are optional
.endpointServiceName("endpointServiceName")
.textIndexName("textIndexName")
.build())
.neptuneAnalyticsConfiguration(NeptuneAnalyticsConfigurationProperty.builder()
.fieldMapping(NeptuneAnalyticsFieldMappingProperty.builder()
.metadataField("metadataField")
.textField("textField")
.build())
.graphArn("graphArn")
.build())
.opensearchManagedClusterConfiguration(OpenSearchManagedClusterConfigurationProperty.builder()
.domainArn("domainArn")
.domainEndpoint("domainEndpoint")
.fieldMapping(OpenSearchManagedClusterFieldMappingProperty.builder()
.metadataField("metadataField")
.textField("textField")
.vectorField("vectorField")
.build())
.vectorIndexName("vectorIndexName")
.build())
.opensearchServerlessConfiguration(OpenSearchServerlessConfigurationProperty.builder()
.collectionArn("collectionArn")
.fieldMapping(OpenSearchServerlessFieldMappingProperty.builder()
.metadataField("metadataField")
.textField("textField")
.vectorField("vectorField")
.build())
.vectorIndexName("vectorIndexName")
.build())
.pineconeConfiguration(PineconeConfigurationProperty.builder()
.connectionString("connectionString")
.credentialsSecretArn("credentialsSecretArn")
.fieldMapping(PineconeFieldMappingProperty.builder()
.metadataField("metadataField")
.textField("textField")
.build())
// the properties below are optional
.namespace("namespace")
.build())
.rdsConfiguration(RdsConfigurationProperty.builder()
.credentialsSecretArn("credentialsSecretArn")
.databaseName("databaseName")
.fieldMapping(RdsFieldMappingProperty.builder()
.metadataField("metadataField")
.primaryKeyField("primaryKeyField")
.textField("textField")
.vectorField("vectorField")
// the properties below are optional
.customMetadataField("customMetadataField")
.build())
.resourceArn("resourceArn")
.tableName("tableName")
.build())
.build())
.tags(Map.of(
"tagsKey", "tags"))
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThe vector configuration details for the Bedrock embeddings model.static final classA fluent builder forCfnKnowledgeBase.static interfaceContains configurations for a query, each of which defines information about example queries to help the query engine generate appropriate SQL queries.static interfaceThe configuration details for the embeddings model.static interfaceSettings for an Amazon Kendra knowledge base.static interfaceConfigurations to apply to a knowledge base attached to the agent during query.static interfaceContains details about the storage configuration of the knowledge base in MongoDB Atlas.static interfaceContains the names of the fields to which to map information about the vector store.static interfaceContains details about the storage configuration of the knowledge base in Amazon Neptune Analytics.static interfaceContains the names of the fields to which to map information about the vector store.static interfaceContains details about the Managed Cluster configuration of the knowledge base in Amazon OpenSearch Service.static interfaceContains the names of the fields to which to map information about the vector store.static interfaceContains details about the storage configuration of the knowledge base in Amazon OpenSearch Service.static interfaceContains the names of the fields to which to map information about the vector store.static interfaceContains details about the storage configuration of the knowledge base in Pinecone.static interfaceContains the names of the fields to which to map information about the vector store.static interfaceContains information about a column in the current table for the query engine to consider.static interfaceContains configurations for query generation.static interfacestatic interfaceContains information about a table for the query engine to consider.static interfaceContains details about the storage configuration of the knowledge base in Amazon RDS.static interfaceContains the names of the fields to which to map information about the vector store.static interfaceContains configurations for an Amazon Redshift database.static interfaceContains configurations for authentication to an Amazon Redshift provisioned data warehouse.static interfaceContains configurations for a provisioned Amazon Redshift query engine.static interfaceContains configurations for storage in AWS Glue Data Catalog.static interfaceContains configurations for an Amazon Redshift query engine.static interfaceContains configurations for storage in Amazon Redshift.static interfaceContains configurations for Amazon Redshift data storage.static interfaceSpecifies configurations for authentication to a Redshift Serverless.static interfaceContains configurations for authentication to Amazon Redshift Serverless.static interfaceA storage location in an Amazon S3 bucket.static interfaceContains configurations for a knowledge base connected to an SQL database.static interfaceContains the storage configuration of the knowledge base.static interfaceSpecifies configurations for the storage location of the images extracted from multimodal documents in your data source.static interfaceContains information about a storage location for images extracted from multimodal documents in your data source.static interfaceContains details about the model used to create vector embeddings for the knowledge base.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.services.bedrock.IKnowledgeBaseRef
IKnowledgeBaseRef.Jsii$Default, IKnowledgeBaseRef.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggableV2
ITaggableV2.Jsii$Default, ITaggableV2.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnKnowledgeBase(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnKnowledgeBase(software.amazon.jsii.JsiiObjectRef objRef) CfnKnowledgeBase(software.constructs.Construct scope, String id, CfnKnowledgeBaseProps props) -
Method Summary
Modifier and TypeMethodDescriptionstatic IKnowledgeBaseReffromKnowledgeBaseArn(software.constructs.Construct scope, String id, String arn) Creates a new IKnowledgeBaseRef from an ARN.static IKnowledgeBaseReffromKnowledgeBaseId(software.constructs.Construct scope, String id, String knowledgeBaseId) Creates a new IKnowledgeBaseRef from a knowledgeBaseId.The time the knowledge base was created.A list of reasons that the API operation on the knowledge base failed.The Amazon Resource Name (ARN) of the knowledge base.The unique identifier for a knowledge base associated with the inline agent.The status of the knowledge base.The time the knowledge base was last updated.Tag Manager which manages the tags for this resource.The description of the knowledge base associated with the inline agent.Contains details about the embeddings configuration of the knowledge base.A reference to a KnowledgeBase resource.getName()The name of the knowledge base.The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the knowledge base.Contains details about the storage configuration of the knowledge base.getTags()Metadata that you can assign to a resource as key-value pairs.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetDescription(String value) The description of the knowledge base associated with the inline agent.voidContains details about the embeddings configuration of the knowledge base.voidContains details about the embeddings configuration of the knowledge base.voidThe name of the knowledge base.voidsetRoleArn(String value) The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the knowledge base.voidContains details about the storage configuration of the knowledge base.voidContains details about the storage configuration of the knowledge base.voidMetadata that you can assign to a resource as key-value pairs.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods 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
getNodeMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnKnowledgeBase
protected CfnKnowledgeBase(software.amazon.jsii.JsiiObjectRef objRef) -
CfnKnowledgeBase
protected CfnKnowledgeBase(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnKnowledgeBase
@Stability(Stable) public CfnKnowledgeBase(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnKnowledgeBaseProps props) - Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
fromKnowledgeBaseArn
@Stability(Stable) @NotNull public static IKnowledgeBaseRef fromKnowledgeBaseArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String arn) Creates a new IKnowledgeBaseRef from an ARN.- Parameters:
scope- This parameter is required.id- This parameter is required.arn- This parameter is required.
-
fromKnowledgeBaseId
@Stability(Stable) @NotNull public static IKnowledgeBaseRef fromKnowledgeBaseId(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String knowledgeBaseId) Creates a new IKnowledgeBaseRef from a knowledgeBaseId.- Parameters:
scope- This parameter is required.id- This parameter is required.knowledgeBaseId- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrCreatedAt
The time the knowledge base was created. -
getAttrFailureReasons
A list of reasons that the API operation on the knowledge base failed. -
getAttrKnowledgeBaseArn
The Amazon Resource Name (ARN) of the knowledge base. -
getAttrKnowledgeBaseId
The unique identifier for a knowledge base associated with the inline agent. -
getAttrStatus
The status of the knowledge base. -
getAttrUpdatedAt
The time the knowledge base was last updated. -
getCdkTagManager
Tag Manager which manages the tags for this resource.- Specified by:
getCdkTagManagerin interfaceITaggableV2
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getKnowledgeBaseRef
A reference to a KnowledgeBase resource.- Specified by:
getKnowledgeBaseRefin interfaceIKnowledgeBaseRef
-
getKnowledgeBaseConfiguration
Contains details about the embeddings configuration of the knowledge base.Returns union: either
IResolvableorCfnKnowledgeBase.KnowledgeBaseConfigurationProperty -
setKnowledgeBaseConfiguration
Contains details about the embeddings configuration of the knowledge base. -
setKnowledgeBaseConfiguration
@Stability(Stable) public void setKnowledgeBaseConfiguration(@NotNull CfnKnowledgeBase.KnowledgeBaseConfigurationProperty value) Contains details about the embeddings configuration of the knowledge base. -
getName
The name of the knowledge base. -
setName
The name of the knowledge base. -
getRoleArn
The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the knowledge base. -
setRoleArn
The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the knowledge base. -
getDescription
The description of the knowledge base associated with the inline agent. -
setDescription
The description of the knowledge base associated with the inline agent. -
getStorageConfiguration
Contains details about the storage configuration of the knowledge base.Returns union: either
IResolvableorCfnKnowledgeBase.StorageConfigurationProperty -
setStorageConfiguration
Contains details about the storage configuration of the knowledge base. -
setStorageConfiguration
@Stability(Stable) public void setStorageConfiguration(@Nullable CfnKnowledgeBase.StorageConfigurationProperty value) Contains details about the storage configuration of the knowledge base. -
getTags
Metadata that you can assign to a resource as key-value pairs.For more information, see the following resources:.
-
setTags
Metadata that you can assign to a resource as key-value pairs.For more information, see the following resources:.
-