Skip to content

Commit ab90a05

Browse files
author
Chelsea Urquhart
committed
set comment explicitly instead of within graph
1 parent 6379209 commit ab90a05

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/aws-cdk-lib/aws-stepfunctions/lib/state-machine.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -715,12 +715,12 @@ export class ChainDefinitionBody extends DefinitionBody {
715715
public bind(scope: Construct, sfnPrincipal: iam.IPrincipal, sfnProps: StateMachineProps): DefinitionConfig {
716716
const graph = new StateGraph(this.chainable.startState, 'State Machine definition');
717717
graph.timeout = sfnProps.timeout;
718-
graph.comment = sfnProps.comment;
719718
for (const statement of graph.policyStatements) {
720719
sfnPrincipal.addToPrincipalPolicy(statement);
721720
}
721+
const graphJson = graph.toGraphJson();
722722
return {
723-
definitionString: Stack.of(scope).toJsonString(graph.toGraphJson()),
723+
definitionString: Stack.of(scope).toJsonString({ ...graphJson, Comment: sfnProps.comment }),
724724
};
725725
}
726726
}

0 commit comments

Comments
 (0)