# HttpStepFunctionsIntegration

The StepFunctions integration resource for HTTP API.

Extends: HttpRouteIntegration › HttpStepFunctionsIntegration

- Source: [`aws-apigatewayv2-integrations/lib/http/stepfunctions.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-apigatewayv2-integrations/lib/http/stepfunctions.ts#L42)
- Type last changed: v2.131.0 · 1 Mar 2024

## Example

```ts
import { HttpStepFunctionsIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
import * as sfn from 'aws-cdk-lib/aws-stepfunctions';

declare const stateMachine: sfn.StateMachine;
declare const httpApi: apigwv2.HttpApi;

httpApi.addRoutes({
  path: '/start',
  methods: [ apigwv2.HttpMethod.POST ],
  integration: new HttpStepFunctionsIntegration('StartExecutionIntegration', {
    stateMachine,
    subtype: apigwv2.HttpIntegrationSubtype.STEPFUNCTIONS_START_EXECUTION,
  }),
});

httpApi.addRoutes({
  path: '/start-sync',
  methods: [ apigwv2.HttpMethod.POST ],
  integration: new HttpStepFunctionsIntegration('StartSyncExecutionIntegration', {
    stateMachine,
    subtype: apigwv2.HttpIntegrationSubtype.STEPFUNCTIONS_START_SYNC_EXECUTION,
  }),
});

httpApi.addRoutes({
  path: '/stop',
  methods: [ apigwv2.HttpMethod.POST ],
  integration: new HttpStepFunctionsIntegration('StopExecutionIntegration', {
    stateMachine,
    subtype: apigwv2.HttpIntegrationSubtype.STEPFUNCTIONS_STOP_EXECUTION,
    // For the `STOP_EXECUTION` subtype, it is necessary to specify the `executionArn`.
    parameterMapping: new apigwv2.ParameterMapping()
      .custom('ExecutionArn', '$request.querystring.executionArn'),
  }),
});
```

## Initializer

```ts
new HttpStepFunctionsIntegration(id: string, props: HttpStepFunctionsIntegrationProps)
```

## Methods

- `bind(options: HttpRouteIntegrationBindOptions): HttpRouteIntegrationConfig` — Bind this integration to the route.
