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

Default authentication flow should fail if invalid profile name is passed #1591

Closed
3 tasks done
gdavison opened this issue Feb 19, 2022 · 2 comments
Closed
3 tasks done
Assignees
Labels
bug This issue is a bug.

Comments

@gdavison
Copy link
Contributor

Documentation

Describe the bug

When the default authentication flow is used with config.LoadDefaultConfig(), providing an invalid profile name, either with config.WithSharedConfigProfile() or by setting AWS_PROFILE, does not cause an error, but falls back to trying IMDS.

Expected behavior

In the AWS CLI, I get

$ AWS_PROFILE=no-such-profile aws sts get-caller-identity

The config profile (no-such-profile) could not be found

The SDK should fail with a config.SharedConfigProfileNotExistError error.

Current behavior

The AWS SDK falls back to calling IMDS

Steps to Reproduce

cfg, err := config.LoadDefaultConfig(ctx)

and set AWS_PROFILE to an invalid profile name

or

cfg, err := config.LoadDefaultConfig(ctx, config.WithSharedConfigProfile("no-such-profile"))

Possible Solution

No response

AWS Go SDK version used

github.com/aws/aws-sdk-go-v2 v1.13.0, github.com/aws/aws-sdk-go-v2/config v1.13.1

Compiler and Version used

go version go1.17.2 darwin/amd64

Operating System and version

N/A

@vudh1
Copy link
Contributor

vudh1 commented May 23, 2022

closing since PR is merged.

@vudh1 vudh1 closed this as completed May 23, 2022
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants