# S3DataSourceConfigurationProperty

Provides the configuration information to connect to an Amazon S3 bucket.

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_kendra as kendra } from 'aws-cdk-lib';
const s3DataSourceConfigurationProperty: kendra.CfnDataSource.S3DataSourceConfigurationProperty = {
  bucketName: 'bucketName',

  // the properties below are optional
  accessControlListConfiguration: {
    keyPath: 'keyPath',
  },
  documentsMetadataConfiguration: {
    s3Prefix: 's3Prefix',
  },
  exclusionPatterns: ['exclusionPatterns'],
  inclusionPatterns: ['inclusionPatterns'],
  inclusionPrefixes: ['inclusionPrefixes'],
};
```

Python:

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

s3_data_source_configuration_property = kendra.CfnDataSource.S3DataSourceConfigurationProperty(
    bucket_name="bucketName",

    # the properties below are optional
    access_control_list_configuration=kendra.CfnDataSource.AccessControlListConfigurationProperty(
        key_path="keyPath"
    ),
    documents_metadata_configuration=kendra.CfnDataSource.DocumentsMetadataConfigurationProperty(
        s3_prefix="s3Prefix"
    ),
    exclusion_patterns=["exclusionPatterns"],
    inclusion_patterns=["inclusionPatterns"],
    inclusion_prefixes=["inclusionPrefixes"]
)
```

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.kendra.*;

S3DataSourceConfigurationProperty s3DataSourceConfigurationProperty = 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();
```

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.Kendra;

var s3DataSourceConfigurationProperty = new S3DataSourceConfigurationProperty {
    BucketName = "bucketName",

    // the properties below are optional
    AccessControlListConfiguration = new AccessControlListConfigurationProperty {
        KeyPath = "keyPath"
    },
    DocumentsMetadataConfiguration = new DocumentsMetadataConfigurationProperty {
        S3Prefix = "s3Prefix"
    },
    ExclusionPatterns = new [] { "exclusionPatterns" },
    InclusionPatterns = new [] { "inclusionPatterns" },
    InclusionPrefixes = new [] { "inclusionPrefixes" }
};
```

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"

s3DataSourceConfigurationProperty := &S3DataSourceConfigurationProperty{
	BucketName: jsii.String("bucketName"),

	// the properties below are optional
	AccessControlListConfiguration: &AccessControlListConfigurationProperty{
		KeyPath: jsii.String("keyPath"),
	},
	DocumentsMetadataConfiguration: &DocumentsMetadataConfigurationProperty{
		S3Prefix: jsii.String("s3Prefix"),
	},
	ExclusionPatterns: []*string{
		jsii.String("exclusionPatterns"),
	},
	InclusionPatterns: []*string{
		jsii.String("inclusionPatterns"),
	},
	InclusionPrefixes: []*string{
		jsii.String("inclusionPrefixes"),
	},
}
```

## Properties

- `accessControlListConfiguration`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnDataSource.AccessControlListConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kendra.CfnDataSource.AccessControlListConfigurationProperty.html) — Provides the path to the S3 bucket that contains the user context filtering files for the data source.

  For the format of the file, see [Access control for S3 data sources](https://docs.aws.amazon.com/kendra/latest/dg/s3-acl.html) .

- `bucketName`: string (required) — The name of the bucket that contains the documents.

- `documentsMetadataConfiguration`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnDataSource.DocumentsMetadataConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kendra.CfnDataSource.DocumentsMetadataConfigurationProperty.html) — Specifies document metadata files that contain information such as the document access control information, source URI, document author, and custom attributes.

  Each metadata file contains metadata about a single document.

- `exclusionPatterns`: string[] — A list of glob patterns (patterns that can expand a wildcard pattern into a list of path names that match the given pattern) for certain file names and file types to exclude from your index.

  If a document matches both an inclusion and exclusion prefix or pattern, the exclusion prefix takes precendence and the document is not indexed. Examples of glob patterns include:

  - * /myapp/config/** —All files inside config directory.
  - *** /*.png* —All .png files in all directories.
  - *** /*.{png, ico, md}* —All .png, .ico or .md files in all directories.
  - * /myapp/src/** /*.ts* —All .ts files inside src directory (and all its subdirectories).
  - *** /!(*.module).ts* —All .ts files but not .module.ts
  - **.png , *.jpg* —All PNG and JPEG image files in a directory (files with the extensions .png and .jpg).
  - **internal** —All files in a directory that contain 'internal' in the file name, such as 'internal', 'internal_only', 'company_internal'.
  - *** /*internal** —All internal-related files in a directory and its subdirectories.

  For more examples, see [Use of Exclude and Include Filters](https://docs.aws.amazon.com/cli/latest/reference/s3/#use-of-exclude-and-include-filters) in the AWS CLI Command Reference.

- `inclusionPatterns`: string[] — A list of glob patterns (patterns that can expand a wildcard pattern into a list of path names that match the given pattern) for certain file names and file types to include in your index.

  If a document matches both an inclusion and exclusion prefix or pattern, the exclusion prefix takes precendence and the document is not indexed. Examples of glob patterns include:

  - * /myapp/config/** —All files inside config directory.
  - *** /*.png* —All .png files in all directories.
  - *** /*.{png, ico, md}* —All .png, .ico or .md files in all directories.
  - * /myapp/src/** /*.ts* —All .ts files inside src directory (and all its subdirectories).
  - *** /!(*.module).ts* —All .ts files but not .module.ts
  - **.png , *.jpg* —All PNG and JPEG image files in a directory (files with the extensions .png and .jpg).
  - **internal** —All files in a directory that contain 'internal' in the file name, such as 'internal', 'internal_only', 'company_internal'.
  - *** /*internal** —All internal-related files in a directory and its subdirectories.

  For more examples, see [Use of Exclude and Include Filters](https://docs.aws.amazon.com/cli/latest/reference/s3/#use-of-exclude-and-include-filters) in the AWS CLI Command Reference.

- `inclusionPrefixes`: string[] — A list of S3 prefixes for the documents that should be included in the index.
