class S3JsonItemReader
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.StepFunctions.S3JsonItemReader |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsstepfunctions#S3JsonItemReader |
Java | software.amazon.awscdk.services.stepfunctions.S3JsonItemReader |
Python | aws_cdk.aws_stepfunctions.S3JsonItemReader |
TypeScript (source) | aws-cdk-lib » aws_stepfunctions » S3JsonItemReader |
Implements
IItem
Item Reader configuration for iterating over items in a JSON array stored in a S3 file.
Example
import * as s3 from 'aws-cdk-lib/aws-s3';
// create a bucket
const bucket = new s3.Bucket(this, 'Bucket');
const distributedMap = new sfn.DistributedMap(this, 'Distributed Map State', {
itemReader: new sfn.S3JsonItemReader({
bucket: bucket,
key: 'my-key.json',
}),
resultWriter: new sfn.ResultWriter({
bucket: bucket,
prefix: 'my-prefix',
})
});
distributedMap.itemProcessor(new sfn.Pass(this, 'Pass State'));
Initializer
new S3JsonItemReader(props: S3FileItemReaderProps)
Parameters
- props
S3
File Item Reader Props
Properties
Name | Type | Description |
---|---|---|
bucket | IBucket | S3 Bucket containing a file with a list to iterate over. |
input | string | |
key | string | S3 key of a file with a list to iterate over. |
resource | string | ARN for the getObject method of the S3 API This API method is used to iterate all objects in the S3 bucket/prefix. |
max | number | Limits the number of items passed to the Distributed Map state. |
bucket
Type:
IBucket
S3 Bucket containing a file with a list to iterate over.
inputType
Type:
string
key
Type:
string
S3 key of a file with a list to iterate over.
resource
Type:
string
ARN for the getObject
method of the S3 API This API method is used to iterate all objects in the S3 bucket/prefix.
maxItems?
Type:
number
(optional, default: No maxItems)
Limits the number of items passed to the Distributed Map state.
Methods
Name | Description |
---|---|
provide | Compile policy statements to provide relevent permissions to the state machine. |
render() | Renders the ItemReader configuration as JSON object. |
PolicyStatements()
providepublic providePolicyStatements(): PolicyStatement[]
Returns
Compile policy statements to provide relevent permissions to the state machine.
render()
public render(): any
Returns
any
Renders the ItemReader configuration as JSON object.