-
Notifications
You must be signed in to change notification settings - Fork 653
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
[BUG] Cannot load SSO provider #2430
Comments
Wow, after typing up everything and going back through with a fine-toothed comb one more time, I discovered that I was incorrectly passing I guess now my expectation is that the |
Hi @hjkatz, Thanks for reaching out. I'm glad you were able to find the issue.
I'm not sure why you are not seeing an error. When I configure a non existent profile I get an error: package main
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/service/s3"
)
func main() {
cfg, err := config.LoadDefaultConfig(context.Background(),
config.WithSharedConfigProfile("some-profile-that-doesnt-exist"),
config.WithEC2IMDSClientEnableState(imds.ClientDisabled),
config.WithRegion("us-east-1"),
)
if err != nil {
fmt.Println("Error loading configuration:", err)
return
}
// more code
} Will throw:
Can you provide us with a full code snippet that can reproduce this behavior? Thanks, |
Here's the code I used, it's pretty much the same as what you have:
When this code is executed the following is printed:
I would instead expect a message about the profile not found or something like that. I guess the EC2 stuff takes priority b/c I'm on an EC2 instance? Here's the code/output when imds is disabled via code:
Output:
|
Hi @hjkatz , Can you update your SDK version? You are using dependencies that are over 1 year old. Thanks, |
Yes I can do that, but it will be a bit of time. We're currently working through migrating from IAM -> SSO and part of my work involves upgrading the aws pkgs we use too. I'll report back when I can. |
This issue has not received a response in 1 week. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled. |
|
Describe the bug
I'm trying to load a profile from a shared config file that is SSO enabled using
sso-session
and then retrieve the session information from the aws config. But when I do this I only see theec2rolecreds.Provider
being used and not thessocreds.Provider
being used as I would expect.Config:
Env:
Code:
Relevant Output:
Expected Behavior
I expect that
ssocreds.Provider
be used forconfig.Credentials.Retrieve()
Or at least the
config.ConfigSources[*]
that isconfig.SharedConfig
should contain filled values forconfig.SharedConfig.SSO*
fields.Current Behavior
I'm only seeing the ec2 imds provider being used.
Reproduction Steps
I think this is because I'm on an ec2 instance running the sdk.
Possible Solution
No response
Additional Information/Context
I am definitely logged into an sso session using
aws sso login
with the correct profile information.AWS Go SDK V2 Module Versions Used
github.com/aws/aws-sdk-go-v2/internal/[email protected]
github.com/aws/aws-sdk-go-v2/[email protected]
Compiler and Version used
go version go1.21.4 linux/amd64
Operating System and version
Linux devenv-hkatz 6.2.0-1017-aws #17~22.04.1-Ubuntu SMP Fri Nov 17 21:07:13 UTC 2023 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: