class S3ObjectsItemReader
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.StepFunctions.S3ObjectsItemReader |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsstepfunctions#S3ObjectsItemReader |
![]() | software.amazon.awscdk.services.stepfunctions.S3ObjectsItemReader |
![]() | aws_cdk.aws_stepfunctions.S3ObjectsItemReader |
![]() | aws-cdk-lib » aws_stepfunctions » S3ObjectsItemReader |
Implements
IItem
Item Reader configuration for iterating over objects in an S3 bucket.
Example
import * as s3 from 'aws-cdk-lib/aws-s3';
/**
* Tree view of bucket:
* my-bucket
* |
* +--item1
* |
* +--otherItem
* |
* +--item2
* |
* ...
*/
const bucket = new s3.Bucket(this, 'Bucket', {
bucketName: 'my-bucket',
});
const distributedMap = new sfn.DistributedMap(this, 'DistributedMap', {
itemReader: new sfn.S3ObjectsItemReader({
bucket,
prefix: 'item',
}),
});
distributedMap.itemProcessor(new sfn.Pass(this, 'Pass'));
Initializer
new S3ObjectsItemReader(props: S3ObjectsItemReaderProps)
Parameters
- props
S3
Objects Item Reader Props
Properties
Name | Type | Description |
---|---|---|
bucket | IBucket | S3 Bucket containing objects to iterate over. |
resource | string | ARN for the listObjectsV2 method of the S3 API This API method is used to iterate all objects in the S3 bucket/prefix. |
bucket | string | S3 bucket name containing objects to iterate over or a file with a list to iterate over, as JsonPath. |
max | number | Limits the number of items passed to the Distributed Map state. |
prefix? | string | S3 prefix used to limit objects to iterate over. |
bucket
Type:
IBucket
S3 Bucket containing objects to iterate over.
resource
Type:
string
ARN for the listObjectsV2
method of the S3 API This API method is used to iterate all objects in the S3 bucket/prefix.
bucketNamePath?
Type:
string
(optional)
S3 bucket name containing objects to iterate over or a file with a list to iterate over, as JsonPath.
maxItems?
Type:
number
(optional, default: Distributed Map state will iterate over all items provided by the ItemReader)
Limits the number of items passed to the Distributed Map state.
prefix?
Type:
string
(optional, default: No prefix)
S3 prefix used to limit objects to iterate over.
Methods
Name | Description |
---|---|
provide | Compile policy statements to provide relevent permissions to the state machine. |
render(queryLanguage?) | Renders the ItemReader configuration as JSON object. |
validate | Validate that ItemReader contains exactly either. |
providePolicyStatements()
public providePolicyStatements(): PolicyStatement[]
Returns
Compile policy statements to provide relevent permissions to the state machine.
render(queryLanguage?)
public render(queryLanguage?: QueryLanguage): any
Parameters
- queryLanguage
Query
Language
Returns
any
Renders the ItemReader configuration as JSON object.
validateItemReader()
public validateItemReader(): string[]
Returns
string[]
Validate that ItemReader contains exactly either.
See also: bucketNamePath