{"modulePath":"github.com/Method-Security/methodaws","version":"v0.8.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cmd\n\nPackage cmd implements the CobraCLI commands for the methodaws CLI. Subcommands for the CLI should all live within this package. Logic should be delegated to internal packages and functions to keep the CLI commands clean and focused on CLI I/O.\n\n## Types\n\n```go\ntype MethodAws struct {\n\tVersion      string\n\tRootFlags    config.RootFlags\n\tOutputConfig writer.OutputConfig\n\tOutputSignal signal.Signal\n\tAwsConfig    *aws.Config\n\tRootCmd      *cobra.Command\n\t// contains filtered or unexported fields\n}\n```\nMethodAws is the main struct that holds the root command and all subcommands that are used throughout execution of the CLI. It is also responsible for holding the AWS configuration, Output configuration, and Output signal for use by subcommands. The output signal is used to write the output of the command to the desired output format after the execution of the invoked commands Run function.\n\n```go\nfunc NewMethodAws(version string) *MethodAws\n```\nNewMethodAws returns a new MethodAws struct with the provided version string. The MethodAws struct is used to initialize the root command and all subcommands that are used throughout execution of the CLI. We pass the version command in here from the main.go file, where we set the version string during the build process.\n\n```go\nfunc (a *MethodAws) Execute() int\n```\nExecute runs the configured command, ensures failures are serialized, and returns the process exit code.\n\n```go\nfunc (a *MethodAws) InitAPIGatewayCommand()\n```\n\n```go\nfunc (a *MethodAws) InitCloudFrontCommand()\n```\nInitCloudFrontCommand initializes the \\`methodaws cloudfront\\` subcommand that deals with enumerating CloudFront distributions and their related resources.\n\n```go\nfunc (a *MethodAws) InitEc2Command()\n```\nInitEc2Command initializes the \\`methodaws ec2\\` subcommand that deals with enumerating EC2 instances and their related resources.\n\n```go\nfunc (a *MethodAws) InitEksCommand()\n```\nInitEksCommand initializes the \\`methodaws eks\\` subcommand that deals with enumerating EKS instances and their related resources.\n\n```go\nfunc (a *MethodAws) InitIamCommand()\n```\nInitIamCommand initializes the \\`methodaws iam\\` subcommand that deals with enumerating IAM roles, attached policies, inline policies and assume role policies within the AWS account.\n\n```go\nfunc (a *MethodAws) InitLambdaCommand()\n```\n\n```go\nfunc (a *MethodAws) InitLoadBalancerCommand()\n```\n\n```go\nfunc (a *MethodAws) InitRdsCommand()\n```\nInitRdsCommand initializes the \\`methodaws rds\\` subcommand that deals with enumerating RDS instances in the AWS account.\n\n```go\nfunc (a *MethodAws) InitRootCommand()\n```\nInitRootCommand initializes the root command for the methodaws CLI. This command is used to set the global flags that are used by all subcommands, such as the region, output format, and output file. It also initializes the version command that prints the version of the CLI. Critically, this sets the PersistentPreRunE and PersistentPostRunE functions that are inherited by most subcommands. The PersistentPreRunE function is used to validate the region flag and set the AWS configuration. The PersistentPostRunE function is used to write the output of the command to the desired output format after the execution of the invoked command's Run function.\n\n```go\nfunc (a *MethodAws) InitRoute53Command()\n```\nInitRoute53Command initializes the \\`methodaws route53\\` subcommand that deals with enumerating Route53 resources.\n\n```go\nfunc (a *MethodAws) InitS3Command()\n```\n\n```go\nfunc (a *MethodAws) InitSecurityGroupCommand()\n```\nInitSecurityGroupCommand initializes the \\`methodaws securitygroup\\` subcommand that deals with enumerating security groups and their related resources.\n\n```go\nfunc (a *MethodAws) InitStsCommand()\n```\nInitStsCommand initializes the \\`methodaws ec2\\` subcommand that is responsible for interacting with the AWS STS service.\n\n```go\nfunc (a *MethodAws) InitVPCCommand()\n```\nInitVPCCommand initializes the \\`methodaws vpc\\` subcommand that deals with enumerating VPCs and related resources in the AWS account.\n\n```go\nfunc (a *MethodAws) InitWAFCommand()\n```\n\n","path":"github.com/Method-Security/methodaws/cmd","name":"cmd","synopsis":"Package cmd implements the CobraCLI commands for the methodaws CLI.","isRedistributable":true}
