# ResultWriter

Configuration for writing Distributed Map state results to S3.

- Source: [`aws-stepfunctions/lib/states/distributed-map/result-writer.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-stepfunctions/lib/states/distributed-map/result-writer.ts#L173)
- Type last changed: v2.190.0 · 17 Apr 2025

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_s3 as s3 } from 'aws-cdk-lib';
import { aws_stepfunctions as stepfunctions } from 'aws-cdk-lib';

declare const bucket: s3.Bucket;
const resultWriter = new stepfunctions.ResultWriter({
  bucket: bucket,

  // the properties below are optional
  prefix: 'prefix',
});
```

## Initializer

```ts
new ResultWriter(props: ResultWriterProps)
```

## Properties

- `bucket`: [IBucket](/cdk/api/v2/docs/aws-cdk-lib.aws_s3.IBucket.html) (required) — S3 Bucket in which to save Map Run results.

- `prefix`: string — S3 prefix in which to save Map Run results.

  **Default:** No prefix

## Methods

- `providePolicyStatements(): PolicyStatement[]` — Compile policy statements to provide relevent permissions to the state machine.

- `render(queryLanguage?: QueryLanguage): any` — Render ResultWriter in ASL JSON format.
