MCPcopy Create free account
hub / github.com/commitdev/zero / promptAWSProfilePicker

Function promptAWSProfilePicker

internal/init/custom-prompts.go:29–50  ·  view source on GitHub ↗
(params map[string]string)

Source from the content-addressed store, hash-verified

27}
28
29func promptAWSProfilePicker(params map[string]string) error {
30 profiles, err := project.GetAWSProfiles()
31 if err != nil {
32 return err
33 }
34
35 awsPrompt := PromptHandler{
36 Parameter: moduleconfig.Parameter{
37 Field: "aws_profile",
38 Label: "Select AWS Profile",
39 Options: listToPromptOptions(profiles),
40 },
41 Condition: NoCondition,
42 Validate: NoValidation,
43 }
44 _, value := promptParameter(awsPrompt)
45 credErr := project.FillAWSProfile("", value, params)
46 if credErr != nil {
47 return errors.New("Failed to retrieve profile, falling back to User input")
48 }
49 return nil
50}

Callers 1

CustomPromptHandlerFunction · 0.85

Calls 2

listToPromptOptionsFunction · 0.85
promptParameterFunction · 0.85

Tested by

no test coverage detected