tree

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Example (Sub)
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/fix-320.yaml",
	}

	console.NoColour = true

	tree.Cmd.Execute()
}
Output:
Resources:
  BackupSelection:
    DependsOn:
      Parameters:
        - AWS::AccountId
        - AWS::Partition
        - AWS::Region
        - AWS::StackName
        - BackupPlanId
      Resources:
        - EfsFileSystem
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