Skip to content

Commit 2173d6d

Browse files
committed
Added doc for build_cloudformation_template
1 parent e8ef5c5 commit 2173d6d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/stepfunctions/workflow/cloudformation.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@
1818

1919
logger = logging.getLogger('stepfunctions')
2020

21+
2122
def repr_str(dumper, data):
2223
if '\n' in data:
2324
return dumper.represent_scalar(u'tag:yaml.org,2002:str', data, style='|')
2425
return dumper.org_represent_str(data)
2526

27+
2628
yaml.SafeDumper.org_represent_str = yaml.SafeDumper.represent_str
2729
yaml.add_representer(dict, lambda self, data: yaml.representer.SafeRepresenter.represent_dict(self, data.items()), Dumper=yaml.SafeDumper)
2830
yaml.add_representer(str, repr_str, Dumper=yaml.SafeDumper)
@@ -42,7 +44,14 @@ def repr_str(dumper, data):
4244
}
4345
}
4446

47+
4548
def build_cloudformation_template(workflow, description=None):
49+
"""
50+
Creates a CloudFormation template from the provided Workflow
51+
Args:
52+
workflow (Workflow): Step Functions workflow instance
53+
description (str, optional): Description of the template. If none provided, the default description will be used: "CloudFormation template for AWS Step Functions - State Machine"
54+
"""
4655
logger.warning('To reuse the CloudFormation template in different regions, please make sure to update the region specific AWS resources in the StateMachine definition.')
4756

4857
template = CLOUDFORMATION_BASE_TEMPLATE.copy()

0 commit comments

Comments
 (0)