Add Outputs to template documentation generator
This commit is contained in:
parent
7093ce98dc
commit
d4b6837260
@ -323,7 +323,7 @@ class Stack(object):
|
|||||||
raise e
|
raise e
|
||||||
|
|
||||||
def create_docs(self, template=False):
|
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
|
and create a mardown doc file for the stack
|
||||||
same idea as eg. helm-docs for values.yaml
|
same idea as eg. helm-docs for values.yaml
|
||||||
"""
|
"""
|
||||||
@ -345,6 +345,9 @@ class Stack(object):
|
|||||||
if 'Parameters' in self.cfn_data:
|
if 'Parameters' in self.cfn_data:
|
||||||
data['parameters'] = self.cfn_data['Parameters']
|
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")
|
doc_file = os.path.join(self.ctx['template_path'], self.rel_path, self.stackname.upper() + ".md")
|
||||||
|
|
||||||
with open(doc_file, 'w') as doc_contents:
|
with open(doc_file, 'w') as doc_contents:
|
||||||
|
@ -25,3 +25,12 @@
|
|||||||
| {{ p }} | {{ parameters[p]['Type'] | lower }} | {{ def }} | {{ format }} | {{ parameters[p]['Description'] }} |
|
| {{ p }} | {{ parameters[p]['Type'] | lower }} | {{ def }} | {{ format }} | {{ parameters[p]['Description'] }} |
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if outputs %}
|
||||||
|
## Outputs
|
||||||
|
| Output | Description |
|
||||||
|
|--------|-------------|
|
||||||
|
{% for p in outputs.keys() %}
|
||||||
|
| {{ p }} | {{ outputs[p]['Description'] }} |
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
@ -61,8 +61,8 @@ def setup_logging(debug):
|
|||||||
|
|
||||||
|
|
||||||
def search_refs(template, attributes, mode):
|
def search_refs(template, attributes, mode):
|
||||||
""" Traverses a template and searches for all Fn::GetAtt calls to FortyTwo
|
""" Traverses a template and searches for any remote references and
|
||||||
adding them to the passed in attributes set
|
adds them to the attributes set
|
||||||
"""
|
"""
|
||||||
if isinstance(template, dict):
|
if isinstance(template, dict):
|
||||||
for k, v in template.items():
|
for k, v in template.items():
|
||||||
|
Loading…
Reference in New Issue
Block a user