Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

console command now honors non-Default AWS SSO instances #220

Merged
merged 1 commit into from
Dec 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* AccountAlias/AccountName tags are inconsistenly applied/missing #201
* Honor config.yaml `DefaultSSO` #209
* Setup now defaults to `warn` log level instead of `info` #214
* `console` command did not know when you are using a non-Default SSO instance #208

## [1.6.0] - 2021-12-24

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ The following environment variables are specific to `aws-sso`:
* `AWS_SSO_SESSION_EXPIRATION` -- The date and time when the IAM role credentials will expire
* `AWS_SSO_DEFAULT_REGION` -- Tracking variable for `AWS_DEFAULT_REGION`
* `AWS_SSO_PROFILE` -- User customizable varible using the [ProfileFormat](#profileformat) template
* `AWS_SSO` -- AWS SSO instance name

## Release History

Expand Down
1 change: 1 addition & 0 deletions cmd/eval_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ func unsetEnvVars(ctx *RunContext) error {
"AWS_SSO_ROLE_ARN",
"AWS_SSO_SESSION_EXPIRATION",
"AWS_SSO_PROFILE",
"AWS_SSO",
}

// clear the region if
Expand Down
3 changes: 2 additions & 1 deletion cmd/exec_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (cc *ExecCmd) Run(ctx *RunContext) error {
return err
}
if err = ctx.Settings.Cache.Expired(sso); err != nil {
log.Warnf(err.Error())
log.Infof(err.Error())
c := &CacheCmd{}
if err = c.Run(ctx); err != nil {
return err
Expand Down Expand Up @@ -165,6 +165,7 @@ func execShellEnvs(ctx *RunContext, awssso *sso.AWSSSO, accountid int64, role, r
"AWS_SSO_ROLE_NAME": creds.RoleName,
"AWS_SSO_SESSION_EXPIRATION": creds.ExpireString(),
"AWS_SSO_ROLE_ARN": utils.MakeRoleARN(creds.AccountId, creds.RoleName),
"AWS_SSO": ctx.Cli.SSO,
}

if len(region) > 0 {
Expand Down
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ type CLI struct {
Lines bool `kong:"help='Print line number in logs'"`
LogLevel string `kong:"short='L',name='level',help='Logging level [error|warn|info|debug|trace] (default: info)'"`
UrlAction string `kong:"short='u',help='How to handle URLs [open|print|clip] (default: open)'"`
SSO string `kong:"short='S',help='AWS SSO Instance',env='AWS_SSO',predictor='sso'"`
SSO string `kong:"short='S',help='Override default AWS SSO Instance',env='AWS_SSO',predictor='sso'"`
STSRefresh bool `kong:"help='Force refresh of STS Token Credentials'"`

// Commands
Expand Down
2 changes: 1 addition & 1 deletion sso/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func LoadSettings(configFile, cacheFile string, defaults map[string]interface{},
// load the cache
var err error
if s.Cache, err = OpenCache(s.cacheFile, s); err != nil {
log.Warnf("%s", err.Error())
log.Infof("%s", err.Error())
}

return s, nil
Expand Down