# S3FileItemReaderProps

Base interface for Item Reader configuration properties the iterate over entries in a S3 file.

Extends: S3FileItemReaderProps
Extends: ItemReaderProps
Used as props by: S3JsonItemReader, S3JsonLItemReader, S3ManifestItemReader

- Source: [`aws-stepfunctions/lib/states/distributed-map/item-reader.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-stepfunctions/lib/states/distributed-map/item-reader.ts#L197)
- Type last changed: v2.127.0 · 10 Feb 2024

## Example

```ts
import * as s3 from 'aws-cdk-lib/aws-s3';

/**
 * Tree view of bucket:
 *  my-bucket
 *  |
 *  +--input.json
 *  |
 *  ...
 *
 * File content of input.json:
 *  [
 *    "item1",
 *    "item2"
 *  ]
 */
const bucket = new s3.Bucket(this, 'Bucket', {
  bucketName: 'my-bucket',
});

const distributedMap = new sfn.DistributedMap(this, 'DistributedMap', {
  itemReader: new sfn.S3JsonItemReader({
    bucket,
    key: 'input.json',
  }),
});
distributedMap.itemProcessor(new sfn.Pass(this, 'Pass'));
```

## Properties

- `bucket`: [IBucket](/cdk/api/v2/docs/aws-cdk-lib.aws_s3.IBucket.html) — S3 Bucket containing objects to iterate over or a file with a list to iterate over.

  **Default:** S3 bucket will be determined from

- `bucketNamePath`: string — S3 bucket name containing objects to iterate over or a file with a list to iterate over, as JsonPath.

  **Default:** S3 bucket will be determined from

- `key`: string (required) — Key of file stored in S3 bucket containing an array to iterate over.

- `maxItems`: number — Limits the number of items passed to the Distributed Map state.

  **Default:** Distributed Map state will iterate over all items provided by the ItemReader
