-
-
Notifications
You must be signed in to change notification settings - Fork 153
Expand file tree
/
Copy pathaws.go
More file actions
87 lines (68 loc) · 2.74 KB
/
aws.go
File metadata and controls
87 lines (68 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package aws
import (
"github.com/spf13/cobra"
awscompliance "github.com/cloudposse/atmos/cmd/aws/compliance"
"github.com/cloudposse/atmos/cmd/aws/ecr"
"github.com/cloudposse/atmos/cmd/aws/eks"
awssecurity "github.com/cloudposse/atmos/cmd/aws/security"
"github.com/cloudposse/atmos/cmd/internal"
"github.com/cloudposse/atmos/pkg/flags"
"github.com/cloudposse/atmos/pkg/flags/compat"
)
// doubleDashHint is displayed in help output.
const doubleDashHint = "Use double dashes to separate Atmos-specific options from native arguments and flags for the command."
// awsCmd executes 'aws' CLI commands.
var awsCmd = &cobra.Command{
Use: "aws",
Short: "Run AWS-specific commands for interacting with cloud resources",
Long: `This command allows interaction with AWS resources through various CLI commands.`,
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: false},
Args: cobra.NoArgs,
}
func init() {
awsCmd.PersistentFlags().Bool("", false, doubleDashHint)
// Add ECR subcommand from the ecr subpackage.
awsCmd.AddCommand(ecr.EcrCmd)
// Add EKS subcommand from the eks subpackage.
awsCmd.AddCommand(eks.EksCmd)
// Add Security subcommand from the security subpackage.
awsCmd.AddCommand(awssecurity.SecurityCmd)
// Add Compliance subcommand from the compliance subpackage.
awsCmd.AddCommand(awscompliance.ComplianceCmd)
// Register this command with the registry.
internal.Register(&AWSCommandProvider{})
}
// AWSCommandProvider implements the CommandProvider interface.
type AWSCommandProvider struct{}
// GetCommand returns the aws command.
func (a *AWSCommandProvider) GetCommand() *cobra.Command {
return awsCmd
}
// GetName returns the command name.
func (a *AWSCommandProvider) GetName() string {
return "aws"
}
// GetGroup returns the command group for help organization.
func (a *AWSCommandProvider) GetGroup() string {
return "Cloud Integration"
}
// GetAliases returns command aliases.
func (a *AWSCommandProvider) GetAliases() []internal.CommandAlias {
return nil // No aliases for aws command.
}
// GetFlagsBuilder returns the flags builder for this command.
func (a *AWSCommandProvider) GetFlagsBuilder() flags.Builder {
return nil
}
// GetPositionalArgsBuilder returns the positional args builder for this command.
func (a *AWSCommandProvider) GetPositionalArgsBuilder() *flags.PositionalArgsBuilder {
return nil // AWS command has subcommands, not positional args.
}
// GetCompatibilityFlags returns compatibility flags for this command.
func (a *AWSCommandProvider) GetCompatibilityFlags() map[string]compat.CompatibilityFlag {
return nil
}
// IsExperimental returns whether this command is experimental.
func (a *AWSCommandProvider) IsExperimental() bool {
return false
}