Skip to content

extractAslFromTemplate

function extractAslFromTemplate(params): ExtractAslResult;

Defined in: src/cfn/extract.ts:37

Recovers a renderable ASL definition from a CloudFormation/SAM/CDK template.

Locates the AWS::StepFunctions::StateMachine resource (disambiguated with resourceId when the template has more than one), flattens the intrinsics in its DefinitionString/Definition, applies DefinitionSubstitutions, and parses the result as ASL.

ExtractAslFromTemplateParams

Template source, optional format, optional resource id.

ExtractAslResult

The extracted ASL definition, the logical id used, and any warnings.

If no state machine is found, the choice is ambiguous, or the definition is external (DefinitionUri).

const { aslDefinition } = extractAslFromTemplate({ template: cdkSynthJson });