tree

package
v1.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Example (Tree)
package main

import (
	"os"

	"github.com/aws-cloudformation/rain/internal/cmd/tree"
	"github.com/aws-cloudformation/rain/internal/console"
)

func main() {
	os.Args = []string{
		os.Args[0],
		"../../../test/templates/success.template",
	}

	console.NoColour = true

	tree.Cmd.Execute()
}
Output:

Resources:
  Bucket1:
    DependsOn:
      Parameters:
        - BucketName

Index

Examples

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:                   "tree [template]",
	Short:                 "Find dependencies of Resources and Outputs in a local template",
	Long:                  "Find and display the dependencies between Parameters, Resources, and Outputs in a CloudFormation template.",
	Args:                  cobra.ExactArgs(1),
	Aliases:               []string{"graph"},
	DisableFlagsInUseLine: true,
	Run: func(cmd *cobra.Command, args []string) {
		fileName := args[0]

		t, err := parse.File(fileName)
		if err != nil {
			panic(ui.Errorf(err, "unable to parse template '%s'", fileName))
		}

		g := graph.New(t)

		if dotGraph {
			printDot(g)
		} else {
			printGraph(g, "Parameters")
			printGraph(g, "Resources")
			printGraph(g, "Outputs")
		}
	},
}

Cmd is the tree command's entrypoint

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL