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.106.0 (build e852934)", date="2025-02-06T22:15:50.368Z") @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()
                 .type("type")
                 // the properties below are optional
                 .confluenceConfiguration(ConfluenceDataSourceConfigurationProperty.builder()
                         .sourceConfiguration(ConfluenceSourceConfigurationProperty.builder()
                                 .authType("authType")
                                 .credentialsSecretArn("credentialsSecretArn")
                                 .hostType("hostType")
                                 .hostUrl("hostUrl")
                                 .build())
                         // the properties below are optional
                         .crawlerConfiguration(ConfluenceCrawlerConfigurationProperty.builder()
                                 .filterConfiguration(CrawlFilterConfigurationProperty.builder()
                                         .type("type")
                                         // the properties below are optional
                                         .patternObjectFilter(PatternObjectFilterConfigurationProperty.builder()
                                                 .filters(List.of(PatternObjectFilterProperty.builder()
                                                         .objectType("objectType")
                                                         // the properties below are optional
                                                         .exclusionFilters(List.of("exclusionFilters"))
                                                         .inclusionFilters(List.of("inclusionFilters"))
                                                         .build()))
                                                 .build())
                                         .build())
                                 .build())
                         .build())
                 .s3Configuration(S3DataSourceConfigurationProperty.builder()
                         .bucketArn("bucketArn")
                         // the properties below are optional
                         .bucketOwnerAccountId("bucketOwnerAccountId")
                         .inclusionPrefixes(List.of("inclusionPrefixes"))
                         .build())
                 .salesforceConfiguration(SalesforceDataSourceConfigurationProperty.builder()
                         .sourceConfiguration(SalesforceSourceConfigurationProperty.builder()
                                 .authType("authType")
                                 .credentialsSecretArn("credentialsSecretArn")
                                 .hostUrl("hostUrl")
                                 .build())
                         // the properties below are optional
                         .crawlerConfiguration(SalesforceCrawlerConfigurationProperty.builder()
                                 .filterConfiguration(CrawlFilterConfigurationProperty.builder()
                                         .type("type")
                                         // the properties below are optional
                                         .patternObjectFilter(PatternObjectFilterConfigurationProperty.builder()
                                                 .filters(List.of(PatternObjectFilterProperty.builder()
                                                         .objectType("objectType")
                                                         // the properties below are optional
                                                         .exclusionFilters(List.of("exclusionFilters"))
                                                         .inclusionFilters(List.of("inclusionFilters"))
                                                         .build()))
                                                 .build())
                                         .build())
                                 .build())
                         .build())
                 .sharePointConfiguration(SharePointDataSourceConfigurationProperty.builder()
                         .sourceConfiguration(SharePointSourceConfigurationProperty.builder()
                                 .authType("authType")
                                 .credentialsSecretArn("credentialsSecretArn")
                                 .domain("domain")
                                 .hostType("hostType")
                                 .siteUrls(List.of("siteUrls"))
                                 // the properties below are optional
                                 .tenantId("tenantId")
                                 .build())
                         // the properties below are optional
                         .crawlerConfiguration(SharePointCrawlerConfigurationProperty.builder()
                                 .filterConfiguration(CrawlFilterConfigurationProperty.builder()
                                         .type("type")
                                         // the properties below are optional
                                         .patternObjectFilter(PatternObjectFilterConfigurationProperty.builder()
                                                 .filters(List.of(PatternObjectFilterProperty.builder()
                                                         .objectType("objectType")
                                                         // the properties below are optional
                                                         .exclusionFilters(List.of("exclusionFilters"))
                                                         .inclusionFilters(List.of("inclusionFilters"))
                                                         .build()))
                                                 .build())
                                         .build())
                                 .build())
                         .build())
                 .webConfiguration(WebDataSourceConfigurationProperty.builder()
                         .sourceConfiguration(WebSourceConfigurationProperty.builder()
                                 .urlConfiguration(UrlConfigurationProperty.builder()
                                         .seedUrls(List.of(SeedUrlProperty.builder()
                                                 .url("url")
                                                 .build()))
                                         .build())
                                 .build())
                         // the properties below are optional
                         .crawlerConfiguration(WebCrawlerConfigurationProperty.builder()
                                 .crawlerLimits(WebCrawlerLimitsProperty.builder()
                                         .rateLimit(123)
                                         .build())
                                 .exclusionFilters(List.of("exclusionFilters"))
                                 .inclusionFilters(List.of("inclusionFilters"))
                                 .scope("scope")
                                 .build())
                         .build())
                 .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())
                         .hierarchicalChunkingConfiguration(HierarchicalChunkingConfigurationProperty.builder()
                                 .levelConfigurations(List.of(HierarchicalChunkingLevelConfigurationProperty.builder()
                                         .maxTokens(123)
                                         .build()))
                                 .overlapTokens(123)
                                 .build())
                         .semanticChunkingConfiguration(SemanticChunkingConfigurationProperty.builder()
                                 .breakpointPercentileThreshold(123)
                                 .bufferSize(123)
                                 .maxTokens(123)
                                 .build())
                         .build())
                 .customTransformationConfiguration(CustomTransformationConfigurationProperty.builder()
                         .intermediateStorage(IntermediateStorageProperty.builder()
                                 .s3Location(S3LocationProperty.builder()
                                         .uri("uri")
                                         .build())
                                 .build())
                         .transformations(List.of(TransformationProperty.builder()
                                 .stepToApply("stepToApply")
                                 .transformationFunction(TransformationFunctionProperty.builder()
                                         .transformationLambdaConfiguration(TransformationLambdaConfigurationProperty.builder()
                                                 .lambdaArn("lambdaArn")
                                                 .build())
                                         .build())
                                 .build()))
                         .build())
                 .parsingConfiguration(ParsingConfigurationProperty.builder()
                         .parsingStrategy("parsingStrategy")
                         // the properties below are optional
                         .bedrockDataAutomationConfiguration(BedrockDataAutomationConfigurationProperty.builder()
                                 .parsingModality("parsingModality")
                                 .build())
                         .bedrockFoundationModelConfiguration(BedrockFoundationModelConfigurationProperty.builder()
                                 .modelArn("modelArn")
                                 // the properties below are optional
                                 .parsingModality("parsingModality")
                                 .parsingPrompt(ParsingPromptProperty.builder()
                                         .parsingPromptText("parsingPromptText")
                                         .build())
                                 .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()
      The connection configuration for the data source.
    • setDataSourceConfiguration

      @Stability(Stable) public void setDataSourceConfiguration(@NotNull IResolvable value)
      The connection configuration for the data source.
    • setDataSourceConfiguration

      @Stability(Stable) public void setDataSourceConfiguration(@NotNull CfnDataSource.DataSourceConfigurationProperty value)
      The connection configuration for the data source.
    • 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 the data source.
    • setDataDeletionPolicy

      @Stability(Stable) public void setDataDeletionPolicy(@Nullable String value)
      The data deletion policy for the 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.