# CfnDataSourceProps

Properties for defining a `CfnDataSource`.

Used as props by: [CfnDataSource](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_qbusiness.CfnDataSource.html)

- Source: Generated at build time
- Type last changed: v2.174.0 · 4 Jan 2025

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_qbusiness as qbusiness } from 'aws-cdk-lib';

declare const configuration: any;
const cfnDataSourceProps: qbusiness.CfnDataSourceProps = {
  applicationId: 'applicationId',
  configuration: configuration,
  displayName: 'displayName',
  indexId: 'indexId',

  // the properties below are optional
  description: 'description',
  documentEnrichmentConfiguration: {
    inlineConfigurations: [{
      condition: {
        key: 'key',
        operator: 'operator',

        // the properties below are optional
        value: {
          dateValue: 'dateValue',
          longValue: 123,
          stringListValue: ['stringListValue'],
          stringValue: 'stringValue',
        },
      },
      documentContentOperator: 'documentContentOperator',
      target: {
        key: 'key',

        // the properties below are optional
        attributeValueOperator: 'attributeValueOperator',
        value: {
          dateValue: 'dateValue',
          longValue: 123,
          stringListValue: ['stringListValue'],
          stringValue: 'stringValue',
        },
      },
    }],
    postExtractionHookConfiguration: {
      invocationCondition: {
        key: 'key',
        operator: 'operator',

        // the properties below are optional
        value: {
          dateValue: 'dateValue',
          longValue: 123,
          stringListValue: ['stringListValue'],
          stringValue: 'stringValue',
        },
      },
      lambdaArn: 'lambdaArn',
      roleArn: 'roleArn',
      s3BucketName: 's3BucketName',
    },
    preExtractionHookConfiguration: {
      invocationCondition: {
        key: 'key',
        operator: 'operator',

        // the properties below are optional
        value: {
          dateValue: 'dateValue',
          longValue: 123,
          stringListValue: ['stringListValue'],
          stringValue: 'stringValue',
        },
      },
      lambdaArn: 'lambdaArn',
      roleArn: 'roleArn',
      s3BucketName: 's3BucketName',
    },
  },
  mediaExtractionConfiguration: {
    audioExtractionConfiguration: {
      audioExtractionStatus: 'audioExtractionStatus',
    },
    imageExtractionConfiguration: {
      imageExtractionStatus: 'imageExtractionStatus',
    },
    videoExtractionConfiguration: {
      videoExtractionStatus: 'videoExtractionStatus',
    },
  },
  roleArn: 'roleArn',
  syncSchedule: 'syncSchedule',
  tags: [{
    key: 'key',
    value: 'value',
  }],
  vpcConfiguration: {
    securityGroupIds: ['securityGroupIds'],
    subnetIds: ['subnetIds'],
  },
};
```

Python:

```python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_qbusiness as qbusiness

# configuration: Any

cfn_data_source_props = qbusiness.CfnDataSourceProps(
    application_id="applicationId",
    configuration=configuration,
    display_name="displayName",
    index_id="indexId",

    # the properties below are optional
    description="description",
    document_enrichment_configuration=qbusiness.CfnDataSource.DocumentEnrichmentConfigurationProperty(
        inline_configurations=[qbusiness.CfnDataSource.InlineDocumentEnrichmentConfigurationProperty(
            condition=qbusiness.CfnDataSource.DocumentAttributeConditionProperty(
                key="key",
                operator="operator",

                # the properties below are optional
                value=qbusiness.CfnDataSource.DocumentAttributeValueProperty(
                    date_value="dateValue",
                    long_value=123,
                    string_list_value=["stringListValue"],
                    string_value="stringValue"
                )
            ),
            document_content_operator="documentContentOperator",
            target=qbusiness.CfnDataSource.DocumentAttributeTargetProperty(
                key="key",

                # the properties below are optional
                attribute_value_operator="attributeValueOperator",
                value=qbusiness.CfnDataSource.DocumentAttributeValueProperty(
                    date_value="dateValue",
                    long_value=123,
                    string_list_value=["stringListValue"],
                    string_value="stringValue"
                )
            )
        )],
        post_extraction_hook_configuration=qbusiness.CfnDataSource.HookConfigurationProperty(
            invocation_condition=qbusiness.CfnDataSource.DocumentAttributeConditionProperty(
                key="key",
                operator="operator",

                # the properties below are optional
                value=qbusiness.CfnDataSource.DocumentAttributeValueProperty(
                    date_value="dateValue",
                    long_value=123,
                    string_list_value=["stringListValue"],
                    string_value="stringValue"
                )
            ),
            lambda_arn="lambdaArn",
            role_arn="roleArn",
            s3_bucket_name="s3BucketName"
        ),
        pre_extraction_hook_configuration=qbusiness.CfnDataSource.HookConfigurationProperty(
            invocation_condition=qbusiness.CfnDataSource.DocumentAttributeConditionProperty(
                key="key",
                operator="operator",

                # the properties below are optional
                value=qbusiness.CfnDataSource.DocumentAttributeValueProperty(
                    date_value="dateValue",
                    long_value=123,
                    string_list_value=["stringListValue"],
                    string_value="stringValue"
                )
            ),
            lambda_arn="lambdaArn",
            role_arn="roleArn",
            s3_bucket_name="s3BucketName"
        )
    ),
    media_extraction_configuration=qbusiness.CfnDataSource.MediaExtractionConfigurationProperty(
        audio_extraction_configuration=qbusiness.CfnDataSource.AudioExtractionConfigurationProperty(
            audio_extraction_status="audioExtractionStatus"
        ),
        image_extraction_configuration=qbusiness.CfnDataSource.ImageExtractionConfigurationProperty(
            image_extraction_status="imageExtractionStatus"
        ),
        video_extraction_configuration=qbusiness.CfnDataSource.VideoExtractionConfigurationProperty(
            video_extraction_status="videoExtractionStatus"
        )
    ),
    role_arn="roleArn",
    sync_schedule="syncSchedule",
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    vpc_configuration=qbusiness.CfnDataSource.DataSourceVpcConfigurationProperty(
        security_group_ids=["securityGroupIds"],
        subnet_ids=["subnetIds"]
    )
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.qbusiness.*;

Object configuration;

CfnDataSourceProps cfnDataSourceProps = CfnDataSourceProps.builder()
        .applicationId("applicationId")
        .configuration(configuration)
        .displayName("displayName")
        .indexId("indexId")

        // the properties below are optional
        .description("description")
        .documentEnrichmentConfiguration(DocumentEnrichmentConfigurationProperty.builder()
                .inlineConfigurations(List.of(InlineDocumentEnrichmentConfigurationProperty.builder()
                        .condition(DocumentAttributeConditionProperty.builder()
                                .key("key")
                                .operator("operator")

                                // the properties below are optional
                                .value(DocumentAttributeValueProperty.builder()
                                        .dateValue("dateValue")
                                        .longValue(123)
                                        .stringListValue(List.of("stringListValue"))
                                        .stringValue("stringValue")
                                        .build())
                                .build())
                        .documentContentOperator("documentContentOperator")
                        .target(DocumentAttributeTargetProperty.builder()
                                .key("key")

                                // the properties below are optional
                                .attributeValueOperator("attributeValueOperator")
                                .value(DocumentAttributeValueProperty.builder()
                                        .dateValue("dateValue")
                                        .longValue(123)
                                        .stringListValue(List.of("stringListValue"))
                                        .stringValue("stringValue")
                                        .build())
                                .build())
                        .build()))
                .postExtractionHookConfiguration(HookConfigurationProperty.builder()
                        .invocationCondition(DocumentAttributeConditionProperty.builder()
                                .key("key")
                                .operator("operator")

                                // the properties below are optional
                                .value(DocumentAttributeValueProperty.builder()
                                        .dateValue("dateValue")
                                        .longValue(123)
                                        .stringListValue(List.of("stringListValue"))
                                        .stringValue("stringValue")
                                        .build())
                                .build())
                        .lambdaArn("lambdaArn")
                        .roleArn("roleArn")
                        .s3BucketName("s3BucketName")
                        .build())
                .preExtractionHookConfiguration(HookConfigurationProperty.builder()
                        .invocationCondition(DocumentAttributeConditionProperty.builder()
                                .key("key")
                                .operator("operator")

                                // the properties below are optional
                                .value(DocumentAttributeValueProperty.builder()
                                        .dateValue("dateValue")
                                        .longValue(123)
                                        .stringListValue(List.of("stringListValue"))
                                        .stringValue("stringValue")
                                        .build())
                                .build())
                        .lambdaArn("lambdaArn")
                        .roleArn("roleArn")
                        .s3BucketName("s3BucketName")
                        .build())
                .build())
        .mediaExtractionConfiguration(MediaExtractionConfigurationProperty.builder()
                .audioExtractionConfiguration(AudioExtractionConfigurationProperty.builder()
                        .audioExtractionStatus("audioExtractionStatus")
                        .build())
                .imageExtractionConfiguration(ImageExtractionConfigurationProperty.builder()
                        .imageExtractionStatus("imageExtractionStatus")
                        .build())
                .videoExtractionConfiguration(VideoExtractionConfigurationProperty.builder()
                        .videoExtractionStatus("videoExtractionStatus")
                        .build())
                .build())
        .roleArn("roleArn")
        .syncSchedule("syncSchedule")
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .vpcConfiguration(DataSourceVpcConfigurationProperty.builder()
                .securityGroupIds(List.of("securityGroupIds"))
                .subnetIds(List.of("subnetIds"))
                .build())
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.QBusiness;

var configuration;

var cfnDataSourceProps = new CfnDataSourceProps {
    ApplicationId = "applicationId",
    Configuration = configuration,
    DisplayName = "displayName",
    IndexId = "indexId",

    // the properties below are optional
    Description = "description",
    DocumentEnrichmentConfiguration = new DocumentEnrichmentConfigurationProperty {
        InlineConfigurations = new [] { new InlineDocumentEnrichmentConfigurationProperty {
            Condition = new DocumentAttributeConditionProperty {
                Key = "key",
                Operator = "operator",

                // the properties below are optional
                Value = new DocumentAttributeValueProperty {
                    DateValue = "dateValue",
                    LongValue = 123,
                    StringListValue = new [] { "stringListValue" },
                    StringValue = "stringValue"
                }
            },
            DocumentContentOperator = "documentContentOperator",
            Target = new DocumentAttributeTargetProperty {
                Key = "key",

                // the properties below are optional
                AttributeValueOperator = "attributeValueOperator",
                Value = new DocumentAttributeValueProperty {
                    DateValue = "dateValue",
                    LongValue = 123,
                    StringListValue = new [] { "stringListValue" },
                    StringValue = "stringValue"
                }
            }
        } },
        PostExtractionHookConfiguration = new HookConfigurationProperty {
            InvocationCondition = new DocumentAttributeConditionProperty {
                Key = "key",
                Operator = "operator",

                // the properties below are optional
                Value = new DocumentAttributeValueProperty {
                    DateValue = "dateValue",
                    LongValue = 123,
                    StringListValue = new [] { "stringListValue" },
                    StringValue = "stringValue"
                }
            },
            LambdaArn = "lambdaArn",
            RoleArn = "roleArn",
            S3BucketName = "s3BucketName"
        },
        PreExtractionHookConfiguration = new HookConfigurationProperty {
            InvocationCondition = new DocumentAttributeConditionProperty {
                Key = "key",
                Operator = "operator",

                // the properties below are optional
                Value = new DocumentAttributeValueProperty {
                    DateValue = "dateValue",
                    LongValue = 123,
                    StringListValue = new [] { "stringListValue" },
                    StringValue = "stringValue"
                }
            },
            LambdaArn = "lambdaArn",
            RoleArn = "roleArn",
            S3BucketName = "s3BucketName"
        }
    },
    MediaExtractionConfiguration = new MediaExtractionConfigurationProperty {
        AudioExtractionConfiguration = new AudioExtractionConfigurationProperty {
            AudioExtractionStatus = "audioExtractionStatus"
        },
        ImageExtractionConfiguration = new ImageExtractionConfigurationProperty {
            ImageExtractionStatus = "imageExtractionStatus"
        },
        VideoExtractionConfiguration = new VideoExtractionConfigurationProperty {
            VideoExtractionStatus = "videoExtractionStatus"
        }
    },
    RoleArn = "roleArn",
    SyncSchedule = "syncSchedule",
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } },
    VpcConfiguration = new DataSourceVpcConfigurationProperty {
        SecurityGroupIds = new [] { "securityGroupIds" },
        SubnetIds = new [] { "subnetIds" }
    }
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var configuration interface{}

cfnDataSourceProps := &CfnDataSourceProps{
	ApplicationId: jsii.String("applicationId"),
	Configuration: configuration,
	DisplayName: jsii.String("displayName"),
	IndexId: jsii.String("indexId"),

	// the properties below are optional
	Description: jsii.String("description"),
	DocumentEnrichmentConfiguration: &DocumentEnrichmentConfigurationProperty{
		InlineConfigurations: []interface{}{
			&InlineDocumentEnrichmentConfigurationProperty{
				Condition: &DocumentAttributeConditionProperty{
					Key: jsii.String("key"),
					Operator: jsii.String("operator"),

					// the properties below are optional
					Value: &DocumentAttributeValueProperty{
						DateValue: jsii.String("dateValue"),
						LongValue: jsii.Number(123),
						StringListValue: []*string{
							jsii.String("stringListValue"),
						},
						StringValue: jsii.String("stringValue"),
					},
				},
				DocumentContentOperator: jsii.String("documentContentOperator"),
				Target: &DocumentAttributeTargetProperty{
					Key: jsii.String("key"),

					// the properties below are optional
					AttributeValueOperator: jsii.String("attributeValueOperator"),
					Value: &DocumentAttributeValueProperty{
						DateValue: jsii.String("dateValue"),
						LongValue: jsii.Number(123),
						StringListValue: []*string{
							jsii.String("stringListValue"),
						},
						StringValue: jsii.String("stringValue"),
					},
				},
			},
		},
		PostExtractionHookConfiguration: &HookConfigurationProperty{
			InvocationCondition: &DocumentAttributeConditionProperty{
				Key: jsii.String("key"),
				Operator: jsii.String("operator"),

				// the properties below are optional
				Value: &DocumentAttributeValueProperty{
					DateValue: jsii.String("dateValue"),
					LongValue: jsii.Number(123),
					StringListValue: []*string{
						jsii.String("stringListValue"),
					},
					StringValue: jsii.String("stringValue"),
				},
			},
			LambdaArn: jsii.String("lambdaArn"),
			RoleArn: jsii.String("roleArn"),
			S3BucketName: jsii.String("s3BucketName"),
		},
		PreExtractionHookConfiguration: &HookConfigurationProperty{
			InvocationCondition: &DocumentAttributeConditionProperty{
				Key: jsii.String("key"),
				Operator: jsii.String("operator"),

				// the properties below are optional
				Value: &DocumentAttributeValueProperty{
					DateValue: jsii.String("dateValue"),
					LongValue: jsii.Number(123),
					StringListValue: []*string{
						jsii.String("stringListValue"),
					},
					StringValue: jsii.String("stringValue"),
				},
			},
			LambdaArn: jsii.String("lambdaArn"),
			RoleArn: jsii.String("roleArn"),
			S3BucketName: jsii.String("s3BucketName"),
		},
	},
	MediaExtractionConfiguration: &MediaExtractionConfigurationProperty{
		AudioExtractionConfiguration: &AudioExtractionConfigurationProperty{
			AudioExtractionStatus: jsii.String("audioExtractionStatus"),
		},
		ImageExtractionConfiguration: &ImageExtractionConfigurationProperty{
			ImageExtractionStatus: jsii.String("imageExtractionStatus"),
		},
		VideoExtractionConfiguration: &VideoExtractionConfigurationProperty{
			VideoExtractionStatus: jsii.String("videoExtractionStatus"),
		},
	},
	RoleArn: jsii.String("roleArn"),
	SyncSchedule: jsii.String("syncSchedule"),
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
	VpcConfiguration: &DataSourceVpcConfigurationProperty{
		SecurityGroupIds: []*string{
			jsii.String("securityGroupIds"),
		},
		SubnetIds: []*string{
			jsii.String("subnetIds"),
		},
	},
}
```

## Properties

- `applicationId`: string (required) — The identifier of the Amazon Q Business application the data source will be attached to.

- `configuration`: any (required) — Use this property to specify a JSON or YAML schema with configuration properties specific to your data source connector to connect your data source repository to Amazon Q Business .

  You must use the JSON or YAML schema provided by Amazon Q .

  The following links have the configuration properties and schemas for AWS CloudFormation for the following connectors:

  - [Amazon Simple Storage Service](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/s3-cfn.html)
  - [Amazon Q Web Crawler](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/web-crawler-cfn.html)

  Similarly, you can find configuration templates and properties for your specific data source using the following steps:

  - Navigate to the [Supported connectors](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/connectors-list.html) page in the Amazon Q Business User Guide, and select the data source connector of your choice.
  - Then, from that specific data source connector's page, choose the topic containing *Using CloudFormation* to find the schemas for your data source connector, including configuration parameter descriptions and examples.

- `description`: string — A description for the data source connector.

- `displayName`: string (required) — The name of the Amazon Q Business data source.

- `documentEnrichmentConfiguration`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnDataSource.DocumentEnrichmentConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_qbusiness.CfnDataSource.DocumentEnrichmentConfigurationProperty.html) — Provides the configuration information for altering document metadata and content during the document ingestion process.

  For more information, see [Custom document enrichment](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html) .

- `indexId`: string (required) — The identifier of the index the data source is attached to.

- `mediaExtractionConfiguration`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnDataSource.MediaExtractionConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_qbusiness.CfnDataSource.MediaExtractionConfigurationProperty.html) — The configuration for extracting information from media in documents.

- `roleArn`: string — The Amazon Resource Name (ARN) of an IAM role with permission to access the data source and required resources.

  This field is required for all connector types except custom connectors, where it is optional.

- `syncSchedule`: string — Sets the frequency for Amazon Q Business to check the documents in your data source repository and update your index.

  If you don't set a schedule, Amazon Q Business won't periodically update the index.

  Specify a `cron-` format schedule string or an empty string to indicate that the index is updated on demand. You can't specify the `Schedule` parameter when the `Type` parameter is set to `CUSTOM` . If you do, you receive a `ValidationException` exception.

- `tags`: [CfnTag](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — A list of key-value pairs that identify or categorize the data source connector.

  You can also use tags to help control access to the data source connector. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + -

- `vpcConfiguration`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnDataSource.DataSourceVpcConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_qbusiness.CfnDataSource.DataSourceVpcConfigurationProperty.html) — Configuration information for an Amazon VPC (Virtual Private Cloud) to connect to your data source.

  For more information, see [Using Amazon VPC with Amazon Q Business connectors](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/connector-vpc.html) .
