cmd

package
v0.0.0-...-d0fd1eb Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Username  string
	RolesFile string
)
View Source
var (

	// Input flags
	AccessType   string
	OutputDir    string
	ProfilesFile string
	TagFile      string

	// Set in init()
	LogFile *os.File

	// Set in RootCmd.PersistentPostRun
	Accounts []utils.AccountInfo
	Tags     []string
)
View Source
var (
	AccountIdsFile string
	DocumentName   string
)
View Source
var BucketFile string
View Source
var (
	Cidr string
)
View Source
var RootCmd = &cobra.Command{
	Use:   "aws-go-tool",
	Short: "aws-go-tool is an interface to use with aws accounts",
	Long: `The tool is designed around reporting and interacting with multiple aws accounts.
There are some parts of the tool that are just for single accounts as well.`,
	PersistentPostRun: func(cmd *cobra.Command, args []string) {
		var err error
		Accounts, err = utils.BuildAccountsSlice(ProfilesFile, AccessType)
		if err != nil {
			utils.LogAll("error building accounts slice:", err)
			os.Exit(1)
		}

		if TagFile != "" {
			Tags, err = utils.ReadFile(TagFile)
			if err != nil {
				utils.LogAll("could not open tagFile:", err, "\ncontinuing without tags in output")
			}
		}
	},
}

RootCmd represents the base command when called without any subcommands

Functions

func Execute

func Execute()

Execute adds all child commands to the root command sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

Types

This section is empty.

Jump to

Keyboard shortcuts

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