Skip to content

Commit ccb5129

Browse files
committed
docs: example usage of StateMachine
1 parent 1346790 commit ccb5129

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

packages/cdkConstructs/src/constructs/StateMachine.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,21 @@ export class ExpressStateMachine extends Construct {
6363
public readonly executionPolicy: ManagedPolicy
6464
public readonly stateMachine: StateMachine
6565

66-
/** Provisions an Express Step Functions workflow with logging, tracing, and invoke permissions. */
66+
/**
67+
* Provisions an Express Step Functions workflow with logging, tracing, and invoke permissions.
68+
* @example
69+
* ```ts
70+
* const sm = new ExpressStateMachine(this, "MyWorkflow", {
71+
* stackName: "my-service",
72+
* stateMachineName: "my-service-workflow",
73+
* definition: new Pass(this, "Start"),
74+
* logRetentionInDays: 30,
75+
* additionalPolicies: [myLambdaInvokePolicy]
76+
* })
77+
* // Attach the generated execution policy to an API Gateway role
78+
* apiGatewayRole.addManagedPolicy(sm.executionPolicy)
79+
* ```
80+
*/
6781
public constructor(scope: Construct, id: string, props: StateMachineProps) {
6882
super(scope, id)
6983

0 commit comments

Comments
 (0)