Skip to content

(aws-stepfunctions): L3 Construct for API Gateway HTTP/REST Api Backed by Step Functions #15081

@diegotry

Description

@diegotry

As a CDK user, I'd like to have a simpler way to create an API Gateway (either REST or HTTP) with Step Functions Synchronous Workflows. The new construct will be responsible for creating the API Gateway resources, connecting it to a Step Functions State Machine with the necessary permissions and predefined features.

Use Case

I want to build APIs that are handled by Step Functions as my API orchestrator. The integration with Synchronous workflows was recently launched:

https://aws.amazon.com/about-aws/whats-new/2021/05/amazon-api-gateway-rest-apis-integrates-with-step-funtions-synchronous-express-workflows/ and I want to leverage the infrastructure to CDK.

Proposed Solution

  1. StepFunctionsHttpApi
  • Backed by API Gateway HTTP API
  1. StepFunctionsRestApi
  • Backed by API Gateway REST API

Convention over configuration
Convention over configuration (also known as coding by convention) is a software design paradigm used by software frameworks that attempts to decrease the number of decisions that a developer using the framework is required to make without necessarily losing flexibility.

Convention #1: By default, the Output transformation should return only the Execution Output. If possible, I'd like to have:

HTTP 200: Execution succeeded
HTTP 400: Execution completed, but it failed for some execution-level reason. Example: a validation step. These are for known errors.
HTTP 500: Step Functions failure (server-side, not execution level)

Convention #2: The request body is mapped to the execution input.
Convention #3: All logs from Step Functions are enabled by default
Convention #4: X-Ray is enabled on Step Functions State Machine

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-stepfunctionsRelated to AWS StepFunctionseffort/largeLarge work item – several weeks of effortfeature-requestA feature should be added or improved.feature/patternFeature requests related to high level L3 pattern librariesneeds-discussionThis issue/PR requires more discussion with community.p1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions