HttpStepFunctionsIntegration
- class aws_cdk.aws_apigatewayv2_integrations.HttpStepFunctionsIntegration(id, *, state_machine, parameter_mapping=None, subtype=None)
Bases:
HttpRouteIntegration
The StepFunctions integration resource for HTTP API.
- ExampleMetadata:
infused
Example:
from aws_cdk.aws_apigatewayv2_integrations import HttpStepFunctionsIntegration import aws_cdk.aws_stepfunctions as sfn # state_machine: sfn.StateMachine # http_api: apigwv2.HttpApi http_api.add_routes( path="/start", methods=[apigwv2.HttpMethod.POST], integration=HttpStepFunctionsIntegration("StartExecutionIntegration", state_machine=state_machine, subtype=apigwv2.HttpIntegrationSubtype.STEPFUNCTIONS_START_EXECUTION ) ) http_api.add_routes( path="/start-sync", methods=[apigwv2.HttpMethod.POST], integration=HttpStepFunctionsIntegration("StartSyncExecutionIntegration", state_machine=state_machine, subtype=apigwv2.HttpIntegrationSubtype.STEPFUNCTIONS_START_SYNC_EXECUTION ) ) http_api.add_routes( path="/stop", methods=[apigwv2.HttpMethod.POST], integration=HttpStepFunctionsIntegration("StopExecutionIntegration", state_machine=state_machine, subtype=apigwv2.HttpIntegrationSubtype.STEPFUNCTIONS_STOP_EXECUTION, # For the `STOP_EXECUTION` subtype, it is necessary to specify the `executionArn`. parameter_mapping=apigwv2.ParameterMapping().custom("ExecutionArn", "$request.querystring.executionArn") ) )
- Parameters:
id (
str
) – id of the underlying integration construct.state_machine (
StateMachine
) – Statemachine that Integrates with API Gateway.parameter_mapping (
Optional
[ParameterMapping
]) – Specifies how to transform HTTP requests before sending them to the backend. When the subtype is eitherSTART_EXECUTION
orSTART_SYNC_EXECUTION
, it is necessary to specify theStateMachineArn
. Conversely, when the subtype isSTOP_EXECUTION
, theExecutionArn
must be specified. Default: - specify onlyStateMachineArn
subtype (
Optional
[HttpIntegrationSubtype
]) – The subtype of the HTTP integration. Only subtypes starting with STEPFUNCTIONS_ can be specified. Default: HttpIntegrationSubtype.STEPFUNCTIONS_START_EXECUTION
Methods
- bind(*, route, scope)
Bind this integration to the route.
- Parameters:
route (
IHttpRoute
) – The route to which this is being bound.scope (
Construct
) – The current scope in which the bind is occurring. If theHttpRouteIntegration
being bound creates additional constructs, this will be used as their parent scope.
- Return type: