class ResultWriterV2
| Language | Type name | 
|---|---|
|  .NET | Amazon.CDK.AWS.StepFunctions.ResultWriterV2 | 
|  Go | github.com/aws/aws-cdk-go/awscdk/v2/awsstepfunctions#ResultWriterV2 | 
|  Java | software.amazon.awscdk.services.stepfunctions.ResultWriterV2 | 
|  Python | aws_cdk.aws_stepfunctions.ResultWriterV2 | 
|  TypeScript (source) | aws-cdk-lib»aws_stepfunctions»ResultWriterV2 | 
Configuration for writing Distributed Map state results to S3 The ResultWriter field cannot be empty.
You must specify one of these sets of sub-fields. writerConfig - to preview the formatted output, without saving the results to Amazon S3. bucket and prefix - to save the results to Amazon S3 without additional formatting. All three fields: writerConfig, bucket and prefix - to format the output and save it to Amazon S3.
Example
import * as s3 from 'aws-cdk-lib/aws-s3';
// create a bucket
const bucket = new s3.Bucket(this, 'Bucket');
// create a WriterConfig
const distributedMap = new sfn.DistributedMap(this, 'Distributed Map State', {
  resultWriterV2: new sfn.ResultWriterV2({
    bucket: bucket,
    prefix: 'my-prefix',
    writerConfig: {
      outputType: sfn.OutputType.JSONL,
      transformation: sfn.Transformation.NONE,
    },
  })
});
distributedMap.itemProcessor(new sfn.Pass(this, 'Pass State'));
Initializer
new ResultWriterV2(props: ResultWriterV2Props)
Parameters
- props ResultWriter V2 Props 
Properties
| Name | Type | Description | 
|---|---|---|
| bucket? | IBucket | S3 Bucket in which to save Map Run results. | 
| bucket | string | S3 bucket name in which to save Map Run results, as JsonPath. | 
| prefix? | string | S3 prefix in which to save Map Run results. | 
| writer | Writer | Configuration to format the output of the Child Workflow executions. | 
bucket?
Type:
IBucket
(optional)
S3 Bucket in which to save Map Run results.
bucketNamePath?
Type:
string
(optional)
S3 bucket name in which to save Map Run results, as JsonPath.
prefix?
Type:
string
(optional, default: No prefix)
S3 prefix in which to save Map Run results.
writerConfig?
Type:
Writer
(optional)
Configuration to format the output of the Child Workflow executions.
Methods
| Name | Description | 
|---|---|
| provide | Compile policy statements to provide relevent permissions to the state machine. | 
| render(queryLanguage?) | Render ResultWriter in ASL JSON format. | 
| validate | Validate that ResultWriter 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 QueryLanguage 
Returns
- any
Render ResultWriter in ASL JSON format.
validateResultWriter()  
public validateResultWriter(): string[]
Returns
- string[]
Validate that ResultWriter contains exactly either.
See also: bucketNamePath
