S3FileItemReaderProps

class aws_cdk.aws_stepfunctions.S3FileItemReaderProps(*, bucket, max_items=None, key)

Bases: ItemReaderProps

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

Parameters:
  • bucket (IBucket) – S3 Bucket containing objects to iterate over or a file with a list to iterate over.

  • max_items (Union[int, float, None]) – Limits the number of items passed to the Distributed Map state. Default: - Distributed Map state will iterate over all items provided by the ItemReader

  • key (str) – Key of file stored in S3 bucket containing an array to iterate over.

ExampleMetadata:

infused

Example:

import aws_cdk.aws_s3 as s3


# create a bucket
bucket = s3.Bucket(self, "Bucket")

distributed_map = sfn.DistributedMap(self, "Distributed Map State",
    item_reader=sfn.S3JsonItemReader(
        bucket=bucket,
        key="my-key.json"
    ),
    result_writer=sfn.ResultWriter(
        bucket=bucket,
        prefix="my-prefix"
    )
)
distributed_map.item_processor(sfn.Pass(self, "Pass State"))

Attributes

bucket

S3 Bucket containing objects to iterate over or a file with a list to iterate over.

key

Key of file stored in S3 bucket containing an array to iterate over.

max_items

Limits the number of items passed to the Distributed Map state.

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