Skip to content
aperture

GitHub Action

Cloudformation Diagram Visualization

v1.1.0 Latest version

Cloudformation Diagram Visualization

aperture

Cloudformation Diagram Visualization

GitHub Action for cfn-diagram, the AWS Cloudformation visualization tool

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Cloudformation Diagram Visualization

uses: crisboarna/cfn-diagram-action@v1.1.0

Learn more about this action in crisboarna/cfn-diagram-action

Choose a version

cfn-diagram-action

Description

This action uses cfn-diagram to generate draw.io diagrams or vis.js generated images of your AWS Cloudformation IaC code.

Ideal for maintaining live documentation where the CI auto-updates the infrastructure diagrams for your docs.

Table of Contents

Inputs

path_input

Required

Path where the Cloudformation templates can be found

path_output

Optional Default: diagrams/

Path where the output diagrams should be placed

diagram_type

Optional Default: html

What type of diagram export should be executed

diagram_exclude_types

Optional Default : ``

Cloudformation types to be excluded from cfn-diagram output

diagram_stacks

Optional

Cloudformation stacks to be included in export, defaults to all

viewport_height

Optional Default: 1080

Browser viewport height configuration

viewport_width

Default: 1920

Browser viewport width configuration. Only valid for html|h diagramType

Outputs

The specified diagrams on the filesystem. Only valid for html|h diagramType

Example

uses: crisboarna/cfn-diagram-action@v1
with:
  path_input: '/test/data'
  path_output: '/docs/diagrams'
  diagram_type: 'draw.io'
  diagram_exclude_types: ''
  diagram_stacks: ''
  viewport_height: 1080
  viewport_width: 1920

Development

Installation

To setup for local development you need the following:

yarn install
yarn setup

This installs the npm dependencies and the act cli tool for local GitHub action testing.

Linting

yarn lint

Testing

To run unit tests:

yarn test

To run integration tests locally via Docker Compose use

docker compose up

the output files will be visible in To run integration tests in mock Github Action environment(via Docker)

yarn test:integration:local

To run the underlying integration command locally without the wrapper environment for direct fast debugging

yarn test:integration

Building

How to Contribute

  1. Clone repo and create a new branch:
git checkout https://github.com/crisboarna/cfn-diagram-action -b name_for_new_branch`.
  1. Make changes and test
  2. Submit Pull Request with comprehensive description of changes

Bots used

To facilitate development the following bots are integrated into the repository:

  1. Request Info
  2. Semantic Pull Requests
  3. Welcome
  4. Snyk
  5. Todo

License

CC0

Full license details can be found in LICENSE.md