Class S3ObjectsItemReader

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.stepfunctions.S3ObjectsItemReader
All Implemented Interfaces:
IItemReader, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-27T16:51:05.950Z") @Stability(Stable) public class S3ObjectsItemReader extends software.amazon.jsii.JsiiObject implements IItemReader
Item Reader configuration for iterating over objects in an S3 bucket.

Example:

 import software.amazon.awscdk.services.s3.*;
 /**
  * Tree view of bucket:
  *  my-bucket
  *  |
  *  +--item1
  *  |
  *  +--otherItem
  *  |
  *  +--item2
  *  |
  *  ...
  */
 Bucket bucket = Bucket.Builder.create(this, "Bucket")
         .bucketName("my-bucket")
         .build();
 DistributedMap distributedMap = DistributedMap.Builder.create(this, "DistributedMap")
         .itemReader(S3ObjectsItemReader.Builder.create()
                 .bucket(bucket)
                 .prefix("item")
                 .build())
         .build();
 distributedMap.itemProcessor(new Pass(this, "Pass"));
 
  • Constructor Details

    • S3ObjectsItemReader

      protected S3ObjectsItemReader(software.amazon.jsii.JsiiObjectRef objRef)
    • S3ObjectsItemReader

      protected S3ObjectsItemReader(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • S3ObjectsItemReader

      @Stability(Stable) public S3ObjectsItemReader(@NotNull S3ObjectsItemReaderProps props)
      Parameters:
      props - This parameter is required.
  • Method Details

    • providePolicyStatements

      @Stability(Stable) @NotNull public List<PolicyStatement> providePolicyStatements()
      Compile policy statements to provide relevent permissions to the state machine.
      Specified by:
      providePolicyStatements in interface IItemReader
    • render

      @Stability(Stable) @NotNull public Object render()
      Renders the ItemReader configuration as JSON object.

      Specified by:
      render in interface IItemReader
      Returns:
      • JSON object
    • validateItemReader

      @Stability(Stable) @NotNull public List<String> validateItemReader()
      Validate that ItemReader contains exactly either.

      Specified by:
      validateItemReader in interface IItemReader
      See Also:
    • getBucket

      @Stability(Stable) @NotNull public IBucket getBucket()
      S3 Bucket containing objects to iterate over.
      Specified by:
      getBucket in interface IItemReader
    • getResource

      @Stability(Stable) @NotNull public String getResource()
      ARN for the listObjectsV2 method of the S3 API This API method is used to iterate all objects in the S3 bucket/prefix.
      Specified by:
      getResource in interface IItemReader
    • getBucketNamePath

      @Stability(Stable) @Nullable public String getBucketNamePath()
      S3 bucket name containing objects to iterate over or a file with a list to iterate over, as JsonPath.
      Specified by:
      getBucketNamePath in interface IItemReader
    • getMaxItems

      @Stability(Stable) @Nullable public Number getMaxItems()
      Limits the number of items passed to the Distributed Map state.

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

      Specified by:
      getMaxItems in interface IItemReader
    • getPrefix

      @Stability(Stable) @Nullable public String getPrefix()
      S3 prefix used to limit objects to iterate over.

      Default: - No prefix