A tool to merge a YAML step function definition in with a YAML CloudFormation template file.
Download a binary from the releases page.
You have this at steps.yml
:
StateMachineName: HelloWorld-StateMachine
DefinitionString:
StartAt: HelloWorld
States:
HelloWorld:
Type: Task
Resource: "arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:HelloFunction"
End: true
RoleArn: !Sub "arn:aws:iam::${AWS::AccountId}:role/service-role/StatesExecutionRole-${AWS::Region}"
You want to put it in your CloudFormation template at cftemplate.yml
but you came across this problem. Run the command like so:
cloudsteps -t cftemplate.yml -in steps.yml -t
And it will be added to the resources in the template but embedded as JSON:
AWSTemplateFormatVersion: '2010-09-09'
Description: An example template for a Step Functions state machine.
Resources:
HelloWorld-StateMachine:
Type: AWS::StepFunctions::StateMachine
Properties:
StateMachineName: HelloWorld-StateMachine
DefinitionString:
Fn::Sub: '{"HelloWorld":{"End":true,"Resource":"arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:HelloFunction","Type":"Task"},"StartAt":"HelloWorld","States":null}'
RoleArn: !Sub arn:aws:iam::${AWS::AccountId}:role/service-role/StatesExecutionRole-${AWS::Region}