UNPKG

maestro

Version:

Maestro is a framework for quickly bootstrapping serverless orchestration workflows with AWS Step Functions

19 lines (15 loc) 582 B
const fs = require("fs"); const { iam } = require("../services"); const workflowName = require("../../util/workflowName"); const replacePlaceholders = require("../../util/replacePlaceholders"); const generateStateMachineParams = async (roleName) => { const role = await iam.getRole({ RoleName: roleName }).promise(); const aslTemplate = fs.readFileSync("definition.asl.json").toString(); const definition = replacePlaceholders(aslTemplate); return { definition, name: workflowName, roleArn: role.Role.Arn, }; }; module.exports = generateStateMachineParams;