Extract documentation from an AWS CloudFormation Template
Project description
CFdoc - AWS CloudFormation Template Documentation Tool
CFdoc automatically generates hyperlinked documentation from AWS CloudFormation templates.
Overview
One of the limitations of AWS CloudFormation is the difficulty of embedding comments or other documentation within the JSON used to construct CloudFormation templates. While YAML can contain comments, it can be a tedious process to extract and format useful documentation from them.
CloudFormation templates are not easy to read at the best of times and the inability to properly describe them with embedded documentation makes them difficult to analyse and maintain. That's where CFdoc comes in.
CFdoc exploits the ability to embed Metadata keys containing whatever you want
into the CloudFormation JSON. Metadata keys can be placed in:
- the top level of the CloudFormation template
- within each resource specification in the template.
CFdoc uses descriptive information placed in these keys, together with other information derived from the template to automatically generate documentation.
Even where no special information has been embedded in the CloudFormation template, CFdoc can generate linked documentation for the template that can be much easier to comprehend than the template itself.
Features
- Automatically generates basic documentation from unmodified JSON or YAML (with limitations) CloudFormation templates.
- Generated documentation covers CloudFormation template parameters, resources and outputs.
- Processes embedded documentation / comments within the CloudFormation template to generate more comprehensive, unified documentation.
- Embedded documentation can contain multi-line / multi-paragraph strings.
- Embedded documentation has no impact on normal CloudFormation operation.
- Will find and use Description and Group Description keys in CloudFormation parameter, resource and output specifications. (Only a few resource types support any form of description key.)
- Supports plugins written in Python to process / extend the documentation content prior to rendering. e.g. one of the bundled plugins links AWS resource types to the corresponding AWS CloudFormation documentation.
- Can support multiple documentation output contents, styles and formats using Jinja2 rendering templates. A standard HTML rendering template is included.
- Requires Python 3.
Installation
pip install cfdoc
This will not install the man page. To do that, copy the provided cfdoc.1 man
page to /usr/local/share/man/man1/.
The cfdoc.1 file location can be found thus:
python3 -c 'from importlib import resources; print(resources.files("cfdoc") / "man/cfdoc.1")'
Usage
See the repo for full details.
Basic usage is available in the man page (see Installation above) and with:
cfdoc --help
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file cfdoc-2.1.0.tar.gz.
File metadata
- Download URL: cfdoc-2.1.0.tar.gz
- Upload date:
- Size: 33.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
effc566f6dea8e724dec56df9ff865ebe4b4cd3c61eb2d7bc1ced78de4b7a942
|
|
| MD5 |
7cb224a61c3224e1718e7a166d9b5b3c
|
|
| BLAKE2b-256 |
ce23c1b577dfbf3418e122b831148b68e1ce577cfc09b1702fc6f315bbe00e01
|