Documentation ¶
Index ¶
- func CARSelector(cCtx *cli.Context, car *kion.CAR) error
- func CreateSubShell(accountNumber string, accountAlias string, carName string, stak kion.STAK, ...) error
- func FindCARByName(cars []kion.CAR, carName string) (*kion.CAR, error)
- func LoadConfig(filename string, config *structs.Configuration) error
- func MapAccounts(accounts []kion.Account) ([]string, map[string]kion.Account)
- func MapAccountsFromCARS(cars []kion.CAR, pid uint) ([]string, map[string]string)
- func MapCAR(cars []kion.CAR) ([]string, map[string]kion.CAR)
- func MapFavs(favs []structs.Favorite) ([]string, map[string]structs.Favorite)
- func MapIDMSs(idmss []kion.IDMS) ([]string, map[string]kion.IDMS)
- func MapProjects(projects []kion.Project) ([]string, map[string]kion.Project)
- func OpenBrowser(url string, typeID uint) error
- func PrintSTAK(w io.Writer, stak kion.STAK, region string) error
- func PromptInput(message string) (string, error)
- func PromptPassword(message string) (string, error)
- func PromptSelect(message string, options []string) (string, error)
- func RunCommand(accountNumber string, accountAlias string, carName string, stak kion.STAK, ...) error
- func SaveAWSCreds(stak kion.STAK, car kion.CAR) error
- func SaveConfig(filename string, config structs.Configuration) error
- func SaveSession(filename string, config structs.Configuration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CARSelector ¶ added in v0.0.2
CARSelector is a wizard that walks a user through the selection of a Project, then associated Accounts, then available Cloud Access Roles, to set the user selected Cloud Access Role. Optional account number and or car name can be passed via an existing car struct, the flow will dynamically ask what is needed to be able to find the full car.
func CreateSubShell ¶
func CreateSubShell(accountNumber string, accountAlias string, carName string, stak kion.STAK, region string) error
CreateSubShell creates a sub-shell containing set variables for AWS short term access keys. It attempts to use the users configured shell and rc file while overriding the prompt to indicate the authed AWS account.
func FindCARByName ¶
FindCARByName returns a CAR identified by its name.
func LoadConfig ¶
func LoadConfig(filename string, config *structs.Configuration) error
LoadConfig reads in the configuration yaml file located at `configFile`.
func MapAccounts ¶
MapAccounts transforms a slice of Accounts into a slice of their names and a map indexed by their names.
func MapAccountsFromCARS ¶ added in v0.1.0
MapAccountsFromCARS transforms a slice of CARs into a slice of account names and a map of account numbers indexed by their names. If a project ID is passed it will only return accounts in the given project. Note that some versions of Kion will not populate account metadata in CAR objects so use carefully (see useUpdatedCloudAccessRoleAPI bool).
func MapCAR ¶
MapCAR transforms a slice of CARs into a slice of their names and a map indexed by their names.
func MapFavs ¶
MapFavs transforms a slice of Favorites into a slice of their names and a map indexed by their names.
func MapIDMSs ¶
MapIDMSs transforms a slice of IDMSs into a slice of their names and a map indexed by their names.
func MapProjects ¶
MapProjects transforms a slice of Projects into a slice of their names and a map indexed by their names.
func OpenBrowser ¶
OpenBrowser opens up a URL in the users system default browser.
func PromptInput ¶
PromptInput prompts the user to provide dynamic input.
func PromptPassword ¶
PromptPassword prompts the user to provide sensitive dynamic input.
func PromptSelect ¶
PromptSelect prompts the user to select from a slice of options. It requires that the selection made be one of the options provided.
func RunCommand ¶
func RunCommand(accountNumber string, accountAlias string, carName string, stak kion.STAK, region string, cmd string, args ...string) error
RunCommand executes a one time command with AWS credentials set within the environment. Command output is sent directly to stdout / stderr.
func SaveAWSCreds ¶ added in v0.1.0
SaveAWSCreds saves the short term access keys for AWS auth to the users AWS configuration file.
func SaveConfig ¶
func SaveConfig(filename string, config structs.Configuration) error
SaveConfig saves the entirety of the current config to the users config file.
func SaveSession ¶
func SaveSession(filename string, config structs.Configuration) error
SaveSession updates the session section only of the users config file.
Types ¶
This section is empty.