Skip to content

A simple tool to merge a YAML step function definition into a YAML CloudFormation template

Notifications You must be signed in to change notification settings

autogrow/cloudsteps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cloud Steps

A tool to merge a YAML step function definition in with a YAML CloudFormation template file.

Installation

Download a binary from the releases page.

Usage

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}

About

A simple tool to merge a YAML step function definition into a YAML CloudFormation template

Resources

Stars

Watchers

Forks

Packages

No packages published