Giter Club home page Giter Club logo

cfn-diagram-action's Introduction

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

cfn-diagram-action's People

Contributors

crisboarna avatar dependabot[bot] avatar semantic-release-bot avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

cfn-diagram-action's Issues

fix: Index.js file not found

Description
I just tried to add this to an action to lint a cloud formation template, and in the Action run the job for this diagram update fails with the error message "File not found: '/home/runner/work/_actions/crisboarna/cfn-diagram-action/v1/index.js'"

Steps To Reproduce

  1. Create new Github Action to run on push/pr of path "'**/*.ya?ml'"
  2. Create /docs/diagrams/ folder for output
  3. Job step 1: actions/checkout@v3
  4. Job step 2: crisboarna/cfn-diagram-action@v1 with the following 'with' params:
    a. path_input: '../../cloudformation'
    b. path_output: '../../docs/diagrams'
    c. diagram_type: 'draw.io'
    d. viewport_height: 1080
    e. viewport_width: 1920
  5. Commit & Push new action
  6. See error

Expected Behavior
Diagram to generate off of the one cfn yaml file I have present

Screenshots

Screen Shot 2022-07-06 at 8 33 46 PM

Screen Shot 2022-07-06 at 8 33 14 PM

Additional Context
Add any other context about the problem here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.