diff --git a/cloudbender/stack.py b/cloudbender/stack.py index 426ef68..cfa8cc1 100644 --- a/cloudbender/stack.py +++ b/cloudbender/stack.py @@ -323,7 +323,7 @@ class Stack(object): raise e def create_docs(self, template=False): - """ Read template, parse documentation fragments, eg. parameter description + """ Read rendered template, parse documentation fragments, eg. parameter description and create a mardown doc file for the stack same idea as eg. helm-docs for values.yaml """ @@ -345,6 +345,9 @@ class Stack(object): if 'Parameters' in self.cfn_data: data['parameters'] = self.cfn_data['Parameters'] + if 'Outputs' in self.cfn_data: + data['outputs'] = self.cfn_data['Outputs'] + doc_file = os.path.join(self.ctx['template_path'], self.rel_path, self.stackname.upper() + ".md") with open(doc_file, 'w') as doc_contents: diff --git a/cloudbender/templates/stack-doc.md b/cloudbender/templates/stack-doc.md index 4c84f50..98a6741 100644 --- a/cloudbender/templates/stack-doc.md +++ b/cloudbender/templates/stack-doc.md @@ -25,3 +25,12 @@ | {{ p }} | {{ parameters[p]['Type'] | lower }} | {{ def }} | {{ format }} | {{ parameters[p]['Description'] }} | {% endfor %} {% endif %} + +{% if outputs %} +## Outputs +| Output | Description | +|--------|-------------| +{% for p in outputs.keys() %} +| {{ p }} | {{ outputs[p]['Description'] }} | +{% endfor %} +{% endif %} diff --git a/cloudbender/utils.py b/cloudbender/utils.py index 5e569cf..9951340 100644 --- a/cloudbender/utils.py +++ b/cloudbender/utils.py @@ -61,8 +61,8 @@ def setup_logging(debug): def search_refs(template, attributes, mode): - """ Traverses a template and searches for all Fn::GetAtt calls to FortyTwo - adding them to the passed in attributes set + """ Traverses a template and searches for any remote references and + adds them to the attributes set """ if isinstance(template, dict): for k, v in template.items():