# SfnStateMachineProps

Customize the Step Functions State Machine target.

Extends: SfnStateMachineProps
Extends: TargetBaseProps
Used as props by: SfnStateMachine

- Source: [`aws-events-targets/lib/state-machine.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-events-targets/lib/state-machine.ts#L10)

## Example

```ts
import * as iam from 'aws-cdk-lib/aws-iam';
import * as sfn from 'aws-cdk-lib/aws-stepfunctions';

const rule = new events.Rule(this, 'Rule', {
  schedule: events.Schedule.rate(Duration.minutes(1)),
});

const dlq = new sqs.Queue(this, 'DeadLetterQueue');

const role = new iam.Role(this, 'Role', {
  assumedBy: new iam.ServicePrincipal('events.amazonaws.com'),
});
const stateMachine = new sfn.StateMachine(this, 'SM', {
  definition: new sfn.Wait(this, 'Hello', { time: sfn.WaitTime.duration(Duration.seconds(10)) })
});

rule.addTarget(new targets.SfnStateMachine(stateMachine, {
  input: events.RuleTargetInput.fromObject({ SomeParam: 'SomeValue' }),
  deadLetterQueue: dlq,
  role: role
}));
```

## Properties

- `deadLetterQueue`: [IQueue](/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.IQueue.html) — The SQS queue to be used as deadLetterQueue. Check out the [considerations for using a dead-letter queue](https://docs.aws.amazon.com/eventbridge/latest/userguide/rule-dlq.html#dlq-considerations).

  **Default:** no dead-letter queue

  The events not successfully delivered are automatically retried for a specified period of time,
  depending on the retry policy of the target.
  If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue.

- `input`: [RuleTargetInput](/cdk/api/v2/docs/aws-cdk-lib.aws_events.RuleTargetInput.html) — The input to the state machine execution.

  **Default:** the entire EventBridge event

- `maxEventAge`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) = Duration.hours(24) — The maximum age of a request that Lambda sends to a function for processing.

  Minimum value of 60.
  Maximum value of 86400.

- `retryAttempts`: number = 185 — The maximum number of times to retry when the function returns an error.

  Minimum value of 0.
  Maximum value of 185.

- `role`: [IRole](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) — The IAM role to be assumed to execute the State Machine.

  **Default:** a new role will be created
