S3ObjectsItemReaderProps

class aws_cdk.aws_stepfunctions.S3ObjectsItemReaderProps(*, bucket=None, bucket_name_path=None, max_items=None, prefix=None)

Bases: ItemReaderProps

Properties for configuring an Item Reader that iterates over objects in an S3 bucket.

Parameters:
  • bucket (Optional[IBucket]) – S3 Bucket containing objects to iterate over or a file with a list to iterate over. Default: - S3 bucket will be determined from

  • bucket_name_path (Optional[str]) – 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

  • 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

  • prefix (Optional[str]) – S3 prefix used to limit objects to iterate over. Default: - No prefix

ExampleMetadata:

infused

Example:

import aws_cdk.aws_s3 as s3


#
# Tree view of bucket:
#  my-bucket
#  |
#  +--item1
#  |
#  +--otherItem
#  |
#  +--item2
#  |
#  ...
#
bucket = s3.Bucket(self, "Bucket",
    bucket_name="my-bucket"
)

distributed_map = sfn.DistributedMap(self, "DistributedMap",
    item_reader=sfn.S3ObjectsItemReader(
        bucket=bucket,
        prefix="item"
    )
)
distributed_map.item_processor(sfn.Pass(self, "Pass"))

Attributes

bucket

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

Default:
  • S3 bucket will be determined from

See:

bucketNamePath

bucket_name_path

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

See:

bucket

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

prefix

S3 prefix used to limit objects to iterate over.

Default:
  • No prefix