-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
--endpoint-url
parameter is not used when assuming a role given in a profile via source_profile
#7600
Comments
Hi @aronisstav - thanks for reaching out. |
Updating made this a little better, but not much. I verified that this behavious still exists in:
... but now the request is towards:
|
@aronisstav - Thanks for following up. I just noticed that you have |
@aBurmeseDev - Thank you for following up! Nope, that is not it either, and logically so as the The test I provided seems relatively easy to replicate:
... and inspect the automatically generated AssumeRole request yo see that it is targetting Did you try it? |
Hi @aronisstav - thanks for following up. Unfortunately, I'm not seeing the behavior described on my end. Would you be able to share your debug logs here? That would give us more insight into the issue. |
@aBurmeseDev - Of course. As I said, I expect the request to sts to be towards "http://custom", not sts.us-east-1.amazonaws.com.
|
Also here is the content of my config:
|
@aronisstav - thanks for these logs and additional information. It seems like you're using profile I'm not sure what your credential file looks like but you can try setting the default profile by running
Also If you're using the CLI with MFA, you have to set the session token in addition to setting the access and secret keys. https://aws.amazon.com/premiumsupport/knowledge-center/authenticate-mfa-cli/ If the issue persists, I'd recommend removing Here's docs on working with config variables for your reference: https://awscli.amazonaws.com/v2/documentation/api/latest/topic/config-vars.html Hope that helps, |
@aBurmeseDev - thank you for following up (on a Sunday too)! I don't think we are quite on track to the issue yet... Indeed, as you wrote, "dev" does not have credentials configured, but:
Can you please confirm that the flow I am describing makes sense and |
source_profile
source_profile
--endpoint-url
parameter is not used when assuming a role given in a profile via source_profile
Hi @aronisstav - thank you for your patience while we investigate. I brought this up to the team discussion to verify and the team confirmed that this is expected behavior and not a bug but rather a feature request. Does this issue describes what you're seeing here? Here's more on STS regionalized endpoints: https://docs.aws.amazon.com/sdkref/latest/guide/feature-sts-regionalized-endpoints.html
As far as the credential error you're seeing |
Hi @aBurmeseDev ! I am indeed trying to use AWS CLI towards a privately hosted aws-like platform (I have perhaps incorrectly guessed that this was the only use of |
Just wanted to check in here and share that you can now specify the endpoint to use for all service requests through the shared configuration file and environment variables, as well as specify the endpoint URL for individual AWS services. Here's blogpost that was announced: https://aws.amazon.com/blogs/developer/new-improved-flexibility-when-configuring-endpoint-urls-with-the-aws-sdks-and-tools/ Closing this issue for now and if you have any other questions, please feel free to open a new issue. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the bug
I am using a privately hosted AWS-compatible platform and I am able to use aws-cli using the
--endpoint
parameter. I have configured a role and a user that can assume it without problem (aws --endpoint=... sts assume-role ...
works fine).I have also configured a profile that should automatically assume the role (via a
role_arn
field). However, when executing any aws-cli command using that profile and inspecting the--debug
log I can see that the automatically generated AssumeRole request is targetingsts.amazonaws.com
instead of the custom--endpoint
.Expected Behavior
Automatic requests to assume role should also go to an
--endpoint
if specified.Current Behavior
Automatic requests to assume role go to
sts.amazonaws.com
, and fail.Reproduction Steps
Setup a profile named
withrole
including the following info (it should also include a correctsource_profile
or equivalent)Run:
Inspect the automatically generated AssumeRole request and verify that
host
is targetting the--endpoint
and notsts.amazonaws.com
.Possible Solution
Not familiar enough with the code, but should be relatively easy to have automatic assumerole respect
--endpoint
, as its manual variant does.Additional Information/Context
No response
CLI version used
Environment details (OS name and version, etc.)
WSL2 with Ubuntu on Windows 10 (see above)
The text was updated successfully, but these errors were encountered: