Skip to content

Commit

Permalink
Merge pull request #124 from Cox-Automotive/defect_iamEnable_brokebroke
Browse files Browse the repository at this point in the history
[DEFECT] Replace IsIamEnabled call!
  • Loading branch information
amagana3 committed Apr 22, 2021
2 parents 63e97c0 + 0617f92 commit b5b771c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,12 @@ func (c *Config) Client() (*alks.Client, error) {
}

// Validate STS for IAM active.
validateSTS, err := client.IsIamEnabled("")
if err != nil || validateSTS.IamEnabled != true {
validate, err := client.GetMyLoginRole()
if err != nil {
return nil, err
}

if validate.LoginRole.IamKeyActive != true {
return nil, errors.New("Looks like you are not using ALKS IAM credentials. This will result in errors when creating roles. \n " +
"Note: If using ALKS CLI to get credentials, be sure to use the '-i' flag. \n Please see https://coxautoinc.sharepoint.com/sites/service-internal-tools-team/SitePages/ALKS-Terraform-Provider---Troubleshooting.aspx for more information.")
}
Expand Down

0 comments on commit b5b771c

Please sign in to comment.