projen-statemachine-example
Version:
An example construct for deploying to npm, PyPi, Maven, and Nuget with Amazon API Gateway and AWS Step Functions.
63 lines (62 loc) • 2.15 kB
TypeScript
import * as sfn from 'aws-cdk-lib/aws-stepfunctions';
import { Construct } from 'constructs';
export interface StateMachineApiGatewayExampleProps {
/**
* A stage name for the rest api
*
* @default 'default'
*/
readonly stageName: string;
/**
* The path part for the resource
*
* @default 'pets'
*/
readonly partPath: string;
}
/**
* Converted from an AWS Blog post.
*
* It is the first example mentioned in https://aws.amazon.com/tw/blogs/compute/introducing-amazon-api-gateway-service-integration-for-aws-step-functions/.
* This constcut will create an API Gateway Rest API with two methods and
* are manipulated by a state machine managed in AWS StepFucntions.
*
*/
export declare class StateMachineApiGatewayExample extends Construct {
/**
* sample input to start execution for the workflow.
*/
readonly executionInput: string;
/**
* the representation of a state machine.
*/
readonly stateMachine: sfn.StateMachine;
constructor(parent: Construct, name: string, props: StateMachineApiGatewayExampleProps);
/**
* Creates an API Gateway Rest API.
*
* @param stageName A stage name for the rest api
* @param partPath The path part for the resource
* @returns a rest api.
*/
private _createRestApi;
/**
* Creates an IAM role for Step Functions.
*
* @param restApi The rest APIs for adding and storing pets.
* @param stageName The stage name for the rest api
* @param partPath The path part for the resource
* @returns an IAM role for Step Functions.
*/
private _createWorkFlowRole;
/**
* Creates a workflow.
*
* @param executionRole an IAM role for StepFunctions to execute Rest APIs.
* @param restApi The rest APIs for adding and storing pets.
* @param stageName The stage name for the rest api.
* @param partPath The path part for the resource.
* @returns a state machine.
*/
private _createStateMachine;
}