Skip to content

Commit f0e20eb

Browse files
committed
Verbose output about session for knox connect
1 parent e28ca18 commit f0e20eb

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

internal/connect.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import (
88

99
"github.com/null93/aws-knox/sdk/credentials"
1010
"github.com/null93/aws-knox/sdk/tui"
11+
"github.com/null93/aws-knox/pkg/color"
12+
. "github.com/null93/aws-knox/sdk/style"
1113
"github.com/spf13/cobra"
1214
)
1315

@@ -83,6 +85,17 @@ var connectCmd = &cobra.Command{
8385
continue
8486
}
8587
}
88+
89+
yellow := color.ToForeground(YellowColor).Decorator()
90+
gray := color.ToForeground(LightGrayColor).Decorator()
91+
title := TitleStyle.Decorator()
92+
DefaultStyle.Printfln("")
93+
DefaultStyle.Printfln("%s %s", title("SSO Session: "), gray(role.SessionName))
94+
DefaultStyle.Printfln("%s %s", title("Region: "), gray(role.Region))
95+
DefaultStyle.Printfln("%s %s", title("Account ID: "), gray(role.AccountId))
96+
DefaultStyle.Printfln("%s %s", title("Role Name: "), gray(role.Name))
97+
DefaultStyle.Printfln("%s %s", title("Instance ID: "), yellow(instanceId))
98+
8699
details, err := role.StartSession(instanceId, connectUid)
87100
if err != nil {
88101
ExitWithError(20, "failed to start ssm session", err)

0 commit comments

Comments
 (0)