Class CfnDataSource

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

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-24T21:00:31.463Z") @Stability(Stable) public class CfnDataSource extends CfnResource implements IInspectable, ITaggable
Creates a data source connector that you want to use with an Amazon Kendra index.

You specify a name, data source connector type and description for your data source. You also specify configuration information for the data source connector.

CreateDataSource does not support connectors which require a TemplateConfiguration object for connecting to Amazon Kendra .

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.kendra.*;
 CfnDataSource cfnDataSource = CfnDataSource.Builder.create(this, "MyCfnDataSource")
         .indexId("indexId")
         .name("name")
         .type("type")
         // the properties below are optional
         .customDocumentEnrichmentConfiguration(CustomDocumentEnrichmentConfigurationProperty.builder()
                 .inlineConfigurations(List.of(InlineCustomDocumentEnrichmentConfigurationProperty.builder()
                         .condition(DocumentAttributeConditionProperty.builder()
                                 .conditionDocumentAttributeKey("conditionDocumentAttributeKey")
                                 .operator("operator")
                                 // the properties below are optional
                                 .conditionOnValue(DocumentAttributeValueProperty.builder()
                                         .dateValue("dateValue")
                                         .longValue(123)
                                         .stringListValue(List.of("stringListValue"))
                                         .stringValue("stringValue")
                                         .build())
                                 .build())
                         .documentContentDeletion(false)
                         .target(DocumentAttributeTargetProperty.builder()
                                 .targetDocumentAttributeKey("targetDocumentAttributeKey")
                                 // the properties below are optional
                                 .targetDocumentAttributeValue(DocumentAttributeValueProperty.builder()
                                         .dateValue("dateValue")
                                         .longValue(123)
                                         .stringListValue(List.of("stringListValue"))
                                         .stringValue("stringValue")
                                         .build())
                                 .targetDocumentAttributeValueDeletion(false)
                                 .build())
                         .build()))
                 .postExtractionHookConfiguration(HookConfigurationProperty.builder()
                         .lambdaArn("lambdaArn")
                         .s3Bucket("s3Bucket")
                         // the properties below are optional
                         .invocationCondition(DocumentAttributeConditionProperty.builder()
                                 .conditionDocumentAttributeKey("conditionDocumentAttributeKey")
                                 .operator("operator")
                                 // the properties below are optional
                                 .conditionOnValue(DocumentAttributeValueProperty.builder()
                                         .dateValue("dateValue")
                                         .longValue(123)
                                         .stringListValue(List.of("stringListValue"))
                                         .stringValue("stringValue")
                                         .build())
                                 .build())
                         .build())
                 .preExtractionHookConfiguration(HookConfigurationProperty.builder()
                         .lambdaArn("lambdaArn")
                         .s3Bucket("s3Bucket")
                         // the properties below are optional
                         .invocationCondition(DocumentAttributeConditionProperty.builder()
                                 .conditionDocumentAttributeKey("conditionDocumentAttributeKey")
                                 .operator("operator")
                                 // the properties below are optional
                                 .conditionOnValue(DocumentAttributeValueProperty.builder()
                                         .dateValue("dateValue")
                                         .longValue(123)
                                         .stringListValue(List.of("stringListValue"))
                                         .stringValue("stringValue")
                                         .build())
                                 .build())
                         .build())
                 .roleArn("roleArn")
                 .build())
         .dataSourceConfiguration(DataSourceConfigurationProperty.builder()
                 .confluenceConfiguration(ConfluenceConfigurationProperty.builder()
                         .secretArn("secretArn")
                         .serverUrl("serverUrl")
                         .version("version")
                         // the properties below are optional
                         .attachmentConfiguration(ConfluenceAttachmentConfigurationProperty.builder()
                                 .attachmentFieldMappings(List.of(ConfluenceAttachmentToIndexFieldMappingProperty.builder()
                                         .dataSourceFieldName("dataSourceFieldName")
                                         .indexFieldName("indexFieldName")
                                         // the properties below are optional
                                         .dateFieldFormat("dateFieldFormat")
                                         .build()))
                                 .crawlAttachments(false)
                                 .build())
                         .blogConfiguration(ConfluenceBlogConfigurationProperty.builder()
                                 .blogFieldMappings(List.of(ConfluenceBlogToIndexFieldMappingProperty.builder()
                                         .dataSourceFieldName("dataSourceFieldName")
                                         .indexFieldName("indexFieldName")
                                         // the properties below are optional
                                         .dateFieldFormat("dateFieldFormat")
                                         .build()))
                                 .build())
                         .exclusionPatterns(List.of("exclusionPatterns"))
                         .inclusionPatterns(List.of("inclusionPatterns"))
                         .pageConfiguration(ConfluencePageConfigurationProperty.builder()
                                 .pageFieldMappings(List.of(ConfluencePageToIndexFieldMappingProperty.builder()
                                         .dataSourceFieldName("dataSourceFieldName")
                                         .indexFieldName("indexFieldName")
                                         // the properties below are optional
                                         .dateFieldFormat("dateFieldFormat")
                                         .build()))
                                 .build())
                         .spaceConfiguration(ConfluenceSpaceConfigurationProperty.builder()
                                 .crawlArchivedSpaces(false)
                                 .crawlPersonalSpaces(false)
                                 .excludeSpaces(List.of("excludeSpaces"))
                                 .includeSpaces(List.of("includeSpaces"))
                                 .spaceFieldMappings(List.of(ConfluenceSpaceToIndexFieldMappingProperty.builder()
                                         .dataSourceFieldName("dataSourceFieldName")
                                         .indexFieldName("indexFieldName")
                                         // the properties below are optional
                                         .dateFieldFormat("dateFieldFormat")
                                         .build()))
                                 .build())
                         .vpcConfiguration(DataSourceVpcConfigurationProperty.builder()
                                 .securityGroupIds(List.of("securityGroupIds"))
                                 .subnetIds(List.of("subnetIds"))
                                 .build())
                         .build())
                 .databaseConfiguration(DatabaseConfigurationProperty.builder()
                         .columnConfiguration(ColumnConfigurationProperty.builder()
                                 .changeDetectingColumns(List.of("changeDetectingColumns"))
                                 .documentDataColumnName("documentDataColumnName")
                                 .documentIdColumnName("documentIdColumnName")
                                 // the properties below are optional
                                 .documentTitleColumnName("documentTitleColumnName")
                                 .fieldMappings(List.of(DataSourceToIndexFieldMappingProperty.builder()
                                         .dataSourceFieldName("dataSourceFieldName")
                                         .indexFieldName("indexFieldName")
                                         // the properties below are optional
                                         .dateFieldFormat("dateFieldFormat")
                                         .build()))
                                 .build())
                         .connectionConfiguration(ConnectionConfigurationProperty.builder()
                                 .databaseHost("databaseHost")
                                 .databaseName("databaseName")
                                 .databasePort(123)
                                 .secretArn("secretArn")
                                 .tableName("tableName")
                                 .build())
                         .databaseEngineType("databaseEngineType")
                         // the properties below are optional
                         .aclConfiguration(AclConfigurationProperty.builder()
                                 .allowedGroupsColumnName("allowedGroupsColumnName")
                                 .build())
                         .sqlConfiguration(SqlConfigurationProperty.builder()
                                 .queryIdentifiersEnclosingOption("queryIdentifiersEnclosingOption")
                                 .build())
                         .vpcConfiguration(DataSourceVpcConfigurationProperty.builder()
                                 .securityGroupIds(List.of("securityGroupIds"))
                                 .subnetIds(List.of("subnetIds"))
                                 .build())
                         .build())
                 .googleDriveConfiguration(GoogleDriveConfigurationProperty.builder()
                         .secretArn("secretArn")
                         // the properties below are optional
                         .excludeMimeTypes(List.of("excludeMimeTypes"))
                         .excludeSharedDrives(List.of("excludeSharedDrives"))
                         .excludeUserAccounts(List.of("excludeUserAccounts"))
                         .exclusionPatterns(List.of("exclusionPatterns"))
                         .fieldMappings(List.of(DataSourceToIndexFieldMappingProperty.builder()
                                 .dataSourceFieldName("dataSourceFieldName")
                                 .indexFieldName("indexFieldName")
                                 // the properties below are optional
                                 .dateFieldFormat("dateFieldFormat")
                                 .build()))
                         .inclusionPatterns(List.of("inclusionPatterns"))
                         .build())
                 .oneDriveConfiguration(OneDriveConfigurationProperty.builder()
                         .oneDriveUsers(OneDriveUsersProperty.builder()
                                 .oneDriveUserList(List.of("oneDriveUserList"))
                                 .oneDriveUserS3Path(S3PathProperty.builder()
                                         .bucket("bucket")
                                         .key("key")
                                         .build())
                                 .build())
                         .secretArn("secretArn")
                         .tenantDomain("tenantDomain")
                         // the properties below are optional
                         .disableLocalGroups(false)
                         .exclusionPatterns(List.of("exclusionPatterns"))
                         .fieldMappings(List.of(DataSourceToIndexFieldMappingProperty.builder()
                                 .dataSourceFieldName("dataSourceFieldName")
                                 .indexFieldName("indexFieldName")
                                 // the properties below are optional
                                 .dateFieldFormat("dateFieldFormat")
                                 .build()))
                         .inclusionPatterns(List.of("inclusionPatterns"))
                         .build())
                 .s3Configuration(S3DataSourceConfigurationProperty.builder()
                         .bucketName("bucketName")
                         // the properties below are optional
                         .accessControlListConfiguration(AccessControlListConfigurationProperty.builder()
                                 .keyPath("keyPath")
                                 .build())
                         .documentsMetadataConfiguration(DocumentsMetadataConfigurationProperty.builder()
                                 .s3Prefix("s3Prefix")
                                 .build())
                         .exclusionPatterns(List.of("exclusionPatterns"))
                         .inclusionPatterns(List.of("inclusionPatterns"))
                         .inclusionPrefixes(List.of("inclusionPrefixes"))
                         .build())
                 .salesforceConfiguration(SalesforceConfigurationProperty.builder()
                         .secretArn("secretArn")
                         .serverUrl("serverUrl")
                         // the properties below are optional
                         .chatterFeedConfiguration(SalesforceChatterFeedConfigurationProperty.builder()
                                 .documentDataFieldName("documentDataFieldName")
                                 // the properties below are optional
                                 .documentTitleFieldName("documentTitleFieldName")
                                 .fieldMappings(List.of(DataSourceToIndexFieldMappingProperty.builder()
                                         .dataSourceFieldName("dataSourceFieldName")
                                         .indexFieldName("indexFieldName")
                                         // the properties below are optional
                                         .dateFieldFormat("dateFieldFormat")
                                         .build()))
                                 .includeFilterTypes(List.of("includeFilterTypes"))
                                 .build())
                         .crawlAttachments(false)
                         .excludeAttachmentFilePatterns(List.of("excludeAttachmentFilePatterns"))
                         .includeAttachmentFilePatterns(List.of("includeAttachmentFilePatterns"))
                         .knowledgeArticleConfiguration(SalesforceKnowledgeArticleConfigurationProperty.builder()
                                 .includedStates(List.of("includedStates"))
                                 // the properties below are optional
                                 .customKnowledgeArticleTypeConfigurations(List.of(SalesforceCustomKnowledgeArticleTypeConfigurationProperty.builder()
                                         .documentDataFieldName("documentDataFieldName")
                                         .name("name")
                                         // the properties below are optional
                                         .documentTitleFieldName("documentTitleFieldName")
                                         .fieldMappings(List.of(DataSourceToIndexFieldMappingProperty.builder()
                                                 .dataSourceFieldName("dataSourceFieldName")
                                                 .indexFieldName("indexFieldName")
                                                 // the properties below are optional
                                                 .dateFieldFormat("dateFieldFormat")
                                                 .build()))
                                         .build()))
                                 .standardKnowledgeArticleTypeConfiguration(SalesforceStandardKnowledgeArticleTypeConfigurationProperty.builder()
                                         .documentDataFieldName("documentDataFieldName")
                                         // the properties below are optional
                                         .documentTitleFieldName("documentTitleFieldName")
                                         .fieldMappings(List.of(DataSourceToIndexFieldMappingProperty.builder()
                                                 .dataSourceFieldName("dataSourceFieldName")
                                                 .indexFieldName("indexFieldName")
                                                 // the properties below are optional
                                                 .dateFieldFormat("dateFieldFormat")
                                                 .build()))
                                         .build())
                                 .build())
                         .standardObjectAttachmentConfiguration(SalesforceStandardObjectAttachmentConfigurationProperty.builder()
                                 .documentTitleFieldName("documentTitleFieldName")
                                 .fieldMappings(List.of(DataSourceToIndexFieldMappingProperty.builder()
                                         .dataSourceFieldName("dataSourceFieldName")
                                         .indexFieldName("indexFieldName")
                                         // the properties below are optional
                                         .dateFieldFormat("dateFieldFormat")
                                         .build()))
                                 .build())
                         .standardObjectConfigurations(List.of(SalesforceStandardObjectConfigurationProperty.builder()
                                 .documentDataFieldName("documentDataFieldName")
                                 .name("name")
                                 // the properties below are optional
                                 .documentTitleFieldName("documentTitleFieldName")
                                 .fieldMappings(List.of(DataSourceToIndexFieldMappingProperty.builder()
                                         .dataSourceFieldName("dataSourceFieldName")
                                         .indexFieldName("indexFieldName")
                                         // the properties below are optional
                                         .dateFieldFormat("dateFieldFormat")
                                         .build()))
                                 .build()))
                         .build())
                 .serviceNowConfiguration(ServiceNowConfigurationProperty.builder()
                         .hostUrl("hostUrl")
                         .secretArn("secretArn")
                         .serviceNowBuildVersion("serviceNowBuildVersion")
                         // the properties below are optional
                         .authenticationType("authenticationType")
                         .knowledgeArticleConfiguration(ServiceNowKnowledgeArticleConfigurationProperty.builder()
                                 .documentDataFieldName("documentDataFieldName")
                                 // the properties below are optional
                                 .crawlAttachments(false)
                                 .documentTitleFieldName("documentTitleFieldName")
                                 .excludeAttachmentFilePatterns(List.of("excludeAttachmentFilePatterns"))
                                 .fieldMappings(List.of(DataSourceToIndexFieldMappingProperty.builder()
                                         .dataSourceFieldName("dataSourceFieldName")
                                         .indexFieldName("indexFieldName")
                                         // the properties below are optional
                                         .dateFieldFormat("dateFieldFormat")
                                         .build()))
                                 .filterQuery("filterQuery")
                                 .includeAttachmentFilePatterns(List.of("includeAttachmentFilePatterns"))
                                 .build())
                         .serviceCatalogConfiguration(ServiceNowServiceCatalogConfigurationProperty.builder()
                                 .documentDataFieldName("documentDataFieldName")
                                 // the properties below are optional
                                 .crawlAttachments(false)
                                 .documentTitleFieldName("documentTitleFieldName")
                                 .excludeAttachmentFilePatterns(List.of("excludeAttachmentFilePatterns"))
                                 .fieldMappings(List.of(DataSourceToIndexFieldMappingProperty.builder()
                                         .dataSourceFieldName("dataSourceFieldName")
                                         .indexFieldName("indexFieldName")
                                         // the properties below are optional
                                         .dateFieldFormat("dateFieldFormat")
                                         .build()))
                                 .includeAttachmentFilePatterns(List.of("includeAttachmentFilePatterns"))
                                 .build())
                         .build())
                 .sharePointConfiguration(SharePointConfigurationProperty.builder()
                         .secretArn("secretArn")
                         .sharePointVersion("sharePointVersion")
                         .urls(List.of("urls"))
                         // the properties below are optional
                         .crawlAttachments(false)
                         .disableLocalGroups(false)
                         .documentTitleFieldName("documentTitleFieldName")
                         .exclusionPatterns(List.of("exclusionPatterns"))
                         .fieldMappings(List.of(DataSourceToIndexFieldMappingProperty.builder()
                                 .dataSourceFieldName("dataSourceFieldName")
                                 .indexFieldName("indexFieldName")
                                 // the properties below are optional
                                 .dateFieldFormat("dateFieldFormat")
                                 .build()))
                         .inclusionPatterns(List.of("inclusionPatterns"))
                         .sslCertificateS3Path(S3PathProperty.builder()
                                 .bucket("bucket")
                                 .key("key")
                                 .build())
                         .useChangeLog(false)
                         .vpcConfiguration(DataSourceVpcConfigurationProperty.builder()
                                 .securityGroupIds(List.of("securityGroupIds"))
                                 .subnetIds(List.of("subnetIds"))
                                 .build())
                         .build())
                 .templateConfiguration(TemplateConfigurationProperty.builder()
                         .template("template")
                         .build())
                 .webCrawlerConfiguration(WebCrawlerConfigurationProperty.builder()
                         .urls(WebCrawlerUrlsProperty.builder()
                                 .seedUrlConfiguration(WebCrawlerSeedUrlConfigurationProperty.builder()
                                         .seedUrls(List.of("seedUrls"))
                                         // the properties below are optional
                                         .webCrawlerMode("webCrawlerMode")
                                         .build())
                                 .siteMapsConfiguration(WebCrawlerSiteMapsConfigurationProperty.builder()
                                         .siteMaps(List.of("siteMaps"))
                                         .build())
                                 .build())
                         // the properties below are optional
                         .authenticationConfiguration(WebCrawlerAuthenticationConfigurationProperty.builder()
                                 .basicAuthentication(List.of(WebCrawlerBasicAuthenticationProperty.builder()
                                         .credentials("credentials")
                                         .host("host")
                                         .port(123)
                                         .build()))
                                 .build())
                         .crawlDepth(123)
                         .maxContentSizePerPageInMegaBytes(123)
                         .maxLinksPerPage(123)
                         .maxUrlsPerMinuteCrawlRate(123)
                         .proxyConfiguration(ProxyConfigurationProperty.builder()
                                 .host("host")
                                 .port(123)
                                 // the properties below are optional
                                 .credentials("credentials")
                                 .build())
                         .urlExclusionPatterns(List.of("urlExclusionPatterns"))
                         .urlInclusionPatterns(List.of("urlInclusionPatterns"))
                         .build())
                 .workDocsConfiguration(WorkDocsConfigurationProperty.builder()
                         .organizationId("organizationId")
                         // the properties below are optional
                         .crawlComments(false)
                         .exclusionPatterns(List.of("exclusionPatterns"))
                         .fieldMappings(List.of(DataSourceToIndexFieldMappingProperty.builder()
                                 .dataSourceFieldName("dataSourceFieldName")
                                 .indexFieldName("indexFieldName")
                                 // the properties below are optional
                                 .dateFieldFormat("dateFieldFormat")
                                 .build()))
                         .inclusionPatterns(List.of("inclusionPatterns"))
                         .useChangeLog(false)
                         .build())
                 .build())
         .description("description")
         .languageCode("languageCode")
         .roleArn("roleArn")
         .schedule("schedule")
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .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.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      The Amazon Resource Name (ARN) of the data source. For example:.

      arn:aws:kendra:us-west-2:111122223333:index/335c3741-41df-46a6-b5d3-61f85b787884/data-source/b8cae438-6787-4091-8897-684a652bbb0a

    • getAttrId

      @Stability(Stable) @NotNull public String getAttrId()
      The identifier for the data source. For example:.

      b8cae438-6787-4091-8897-684a652bbb0a .

    • getCfnProperties

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

      @Stability(Stable) @NotNull public TagManager getTags()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • getIndexId

      @Stability(Stable) @NotNull public String getIndexId()
      The identifier of the index you want to use with the data source connector.
    • setIndexId

      @Stability(Stable) public void setIndexId(@NotNull String value)
      The identifier of the index you want to use with the data source connector.
    • 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.
    • getType

      @Stability(Stable) @NotNull public String getType()
      The type of the data source.
    • setType

      @Stability(Stable) public void setType(@NotNull String value)
      The type of the data source.
    • getCustomDocumentEnrichmentConfiguration

      @Stability(Stable) @Nullable public Object getCustomDocumentEnrichmentConfiguration()
      Configuration information for altering document metadata and content during the document ingestion process.
    • setCustomDocumentEnrichmentConfiguration

      @Stability(Stable) public void setCustomDocumentEnrichmentConfiguration(@Nullable IResolvable value)
      Configuration information for altering document metadata and content during the document ingestion process.
    • setCustomDocumentEnrichmentConfiguration

      @Stability(Stable) public void setCustomDocumentEnrichmentConfiguration(@Nullable CfnDataSource.CustomDocumentEnrichmentConfigurationProperty value)
      Configuration information for altering document metadata and content during the document ingestion process.
    • getDataSourceConfiguration

      @Stability(Stable) @Nullable public Object getDataSourceConfiguration()
      Configuration information for an Amazon Kendra data source.
    • setDataSourceConfiguration

      @Stability(Stable) public void setDataSourceConfiguration(@Nullable IResolvable value)
      Configuration information for an Amazon Kendra data source.
    • setDataSourceConfiguration

      @Stability(Stable) public void setDataSourceConfiguration(@Nullable CfnDataSource.DataSourceConfigurationProperty value)
      Configuration information for an Amazon Kendra data source.
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      A description for the data source connector.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      A description for the data source connector.
    • getLanguageCode

      @Stability(Stable) @Nullable public String getLanguageCode()
      The code for a language.
    • setLanguageCode

      @Stability(Stable) public void setLanguageCode(@Nullable String value)
      The code for a language.
    • getRoleArn

      @Stability(Stable) @Nullable public String getRoleArn()
      The Amazon Resource Name (ARN) of a role with permission to access the data source.
    • setRoleArn

      @Stability(Stable) public void setRoleArn(@Nullable String value)
      The Amazon Resource Name (ARN) of a role with permission to access the data source.
    • getSchedule

      @Stability(Stable) @Nullable public String getSchedule()
      Sets the frequency that Amazon Kendra checks the documents in your data source and updates the index.
    • setSchedule

      @Stability(Stable) public void setSchedule(@Nullable String value)
      Sets the frequency that Amazon Kendra checks the documents in your data source and updates the index.
    • getTagsRaw

      @Stability(Stable) @Nullable public List<CfnTag> getTagsRaw()
      An array of key-value pairs to apply to this resource.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable List<CfnTag> value)
      An array of key-value pairs to apply to this resource.