Class CfnDataSource

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-12T19:33:58.303Z") @Stability(Stable) public class CfnDataSource extends CfnResource implements IInspectable
Specifies a data source as a resource in a top-level template. Minimally, you must specify the following properties:.

  • Name – Specify a name for the data source.
  • KnowledgeBaseId – Specify the ID of the knowledge base for the data source to belong to.
  • DataSourceConfiguration – Specify information about the Amazon S3 bucket containing the data source. The following sub-properties are required:
  • Type – Specify the value S3 .

For more information about setting up data sources in Amazon Bedrock , see Set up a data source for your knowledge base .

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.*;
 CfnDataSource cfnDataSource = CfnDataSource.Builder.create(this, "MyCfnDataSource")
         .dataSourceConfiguration(DataSourceConfigurationProperty.builder()
                 .s3Configuration(S3DataSourceConfigurationProperty.builder()
                         .bucketArn("bucketArn")
                         // the properties below are optional
                         .bucketOwnerAccountId("bucketOwnerAccountId")
                         .inclusionPrefixes(List.of("inclusionPrefixes"))
                         .build())
                 .type("type")
                 .build())
         .knowledgeBaseId("knowledgeBaseId")
         .name("name")
         // the properties below are optional
         .dataDeletionPolicy("dataDeletionPolicy")
         .description("description")
         .serverSideEncryptionConfiguration(ServerSideEncryptionConfigurationProperty.builder()
                 .kmsKeyArn("kmsKeyArn")
                 .build())
         .vectorIngestionConfiguration(VectorIngestionConfigurationProperty.builder()
                 .chunkingConfiguration(ChunkingConfigurationProperty.builder()
                         .chunkingStrategy("chunkingStrategy")
                         // the properties below are optional
                         .fixedSizeChunkingConfiguration(FixedSizeChunkingConfigurationProperty.builder()
                                 .maxTokens(123)
                                 .overlapPercentage(123)
                                 .build())
                         .build())
                 .build())
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnDataSource

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

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

      @Stability(Stable) public CfnDataSource(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnDataSourceProps 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

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      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:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrCreatedAt

      @Stability(Stable) @NotNull public String getAttrCreatedAt()
      The time at which the data source was created.
    • getAttrDataSourceId

      @Stability(Stable) @NotNull public String getAttrDataSourceId()
      The unique identifier of the data source.
    • getAttrDataSourceStatus

      @Stability(Stable) @NotNull public String getAttrDataSourceStatus()
      The status of the data source. The following statuses are possible:.

      • Available – The data source has been created and is ready for ingestion into the knowledge base.
      • Deleting – The data source is being deleted.
    • getAttrFailureReasons

      @Stability(Stable) @NotNull public List<String> getAttrFailureReasons()
      The detailed reasons on the failure to delete a data source.
    • getAttrUpdatedAt

      @Stability(Stable) @NotNull public String getAttrUpdatedAt()
      The time at which the data source was last updated.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getDataSourceConfiguration

      @Stability(Stable) @NotNull public Object getDataSourceConfiguration()
      Contains details about how the data source is stored.
    • setDataSourceConfiguration

      @Stability(Stable) public void setDataSourceConfiguration(@NotNull IResolvable value)
      Contains details about how the data source is stored.
    • setDataSourceConfiguration

      @Stability(Stable) public void setDataSourceConfiguration(@NotNull CfnDataSource.DataSourceConfigurationProperty value)
      Contains details about how the data source is stored.
    • getKnowledgeBaseId

      @Stability(Stable) @NotNull public String getKnowledgeBaseId()
      The unique identifier of the knowledge base to which the data source belongs.
    • setKnowledgeBaseId

      @Stability(Stable) public void setKnowledgeBaseId(@NotNull String value)
      The unique identifier of the knowledge base to which the data source belongs.
    • getName

      @Stability(Stable) @NotNull public String getName()
      The name of the data source.
    • setName

      @Stability(Stable) public void setName(@NotNull String value)
      The name of the data source.
    • getDataDeletionPolicy

      @Stability(Stable) @Nullable public String getDataDeletionPolicy()
      The data deletion policy for a data source.
    • setDataDeletionPolicy

      @Stability(Stable) public void setDataDeletionPolicy(@Nullable String value)
      The data deletion policy for a data source.
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      The description of the data source.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      The description of the data source.
    • getServerSideEncryptionConfiguration

      @Stability(Stable) @Nullable public Object getServerSideEncryptionConfiguration()
      Contains details about the configuration of the server-side encryption.
    • setServerSideEncryptionConfiguration

      @Stability(Stable) public void setServerSideEncryptionConfiguration(@Nullable IResolvable value)
      Contains details about the configuration of the server-side encryption.
    • setServerSideEncryptionConfiguration

      @Stability(Stable) public void setServerSideEncryptionConfiguration(@Nullable CfnDataSource.ServerSideEncryptionConfigurationProperty value)
      Contains details about the configuration of the server-side encryption.
    • getVectorIngestionConfiguration

      @Stability(Stable) @Nullable public Object getVectorIngestionConfiguration()
      Contains details about how to ingest the documents in the data source.
    • setVectorIngestionConfiguration

      @Stability(Stable) public void setVectorIngestionConfiguration(@Nullable IResolvable value)
      Contains details about how to ingest the documents in the data source.
    • setVectorIngestionConfiguration

      @Stability(Stable) public void setVectorIngestionConfiguration(@Nullable CfnDataSource.VectorIngestionConfigurationProperty value)
      Contains details about how to ingest the documents in the data source.