# S3CsvItemReaderProps

Properties for configuring an Item Reader that iterates over items in a CSV file in S3.

Extends: [S3FileItemReaderProps](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.S3FileItemReaderProps.html)
Used as props by: [S3CsvItemReader](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.S3CsvItemReader.html)

- Source: [`aws-stepfunctions/lib/states/distributed-map/item-reader.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-stepfunctions/lib/states/distributed-map/item-reader.ts#L393)
- Type last changed: v2.181.0 · 26 Feb 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_s3 as s3 } from 'aws-cdk-lib';
import { aws_stepfunctions as stepfunctions } from 'aws-cdk-lib';

declare const bucket: s3.Bucket;
declare const csvHeaders: stepfunctions.CsvHeaders;
const s3CsvItemReaderProps: stepfunctions.S3CsvItemReaderProps = {
  key: 'key',

  // the properties below are optional
  bucket: bucket,
  bucketNamePath: 'bucketNamePath',
  csvDelimiter: stepfunctions.CsvDelimiter.COMMA,
  csvHeaders: csvHeaders,
  maxItems: 123,
};
```

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_s3 as s3
from aws_cdk import aws_stepfunctions as stepfunctions

# bucket: s3.Bucket
# csv_headers: stepfunctions.CsvHeaders

s3_csv_item_reader_props = stepfunctions.S3CsvItemReaderProps(
    key="key",

    # the properties below are optional
    bucket=bucket,
    bucket_name_path="bucketNamePath",
    csv_delimiter=stepfunctions.CsvDelimiter.COMMA,
    csv_headers=csv_headers,
    max_items=123
)
```

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.s3.*;
import software.amazon.awscdk.services.stepfunctions.*;

Bucket bucket;
CsvHeaders csvHeaders;

S3CsvItemReaderProps s3CsvItemReaderProps = S3CsvItemReaderProps.builder()
        .key("key")

        // the properties below are optional
        .bucket(bucket)
        .bucketNamePath("bucketNamePath")
        .csvDelimiter(CsvDelimiter.COMMA)
        .csvHeaders(csvHeaders)
        .maxItems(123)
        .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.S3;
using Amazon.CDK.AWS.StepFunctions;

Bucket bucket;
CsvHeaders csvHeaders;

var s3CsvItemReaderProps = new S3CsvItemReaderProps {
    Key = "key",

    // the properties below are optional
    Bucket = bucket,
    BucketNamePath = "bucketNamePath",
    CsvDelimiter = CsvDelimiter.COMMA,
    CsvHeaders = csvHeaders,
    MaxItems = 123
};
```

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"
import "github.com/aws/aws-cdk-go/awscdk"

var bucket Bucket
var csvHeaders CsvHeaders

s3CsvItemReaderProps := &S3CsvItemReaderProps{
	Key: jsii.String("key"),

	// the properties below are optional
	Bucket: bucket,
	BucketNamePath: jsii.String("bucketNamePath"),
	CsvDelimiter: awscdk.Aws_stepfunctions.CsvDelimiter_COMMA,
	CsvHeaders: csvHeaders,
	MaxItems: jsii.Number(123),
}
```

## Properties

- `bucket`: [IBucket](https://docs.aws.amazon.com/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

- `csvDelimiter`: [CsvDelimiter](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.CsvDelimiter.html) — Delimiter used in a CSV file.

  **Default:** undefined - Default setting is COMMA.

- `csvHeaders`: [CsvHeaders](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.CsvHeaders.html) — CSV file header configuration.

  **Default:** CsvHeaders with CsvHeadersLocation.FIRST_ROW

- `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
