-
Notifications
You must be signed in to change notification settings - Fork 862
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
region
set in profile in $HOME/.aws/config
is ignored
#3305
Comments
region
set in profile in $HOME/.aws/config
region
set in profile in $HOME/.aws/config
is ignored
Hi @olfek, Thank you for submitting the issue. Using latest .NET SDK and Package version, I unable to reproduce the scenario you mentioned. Can you please review below steps and let me know if I am missing anything? Or kindly assist in providing steps to reproduce the issue.
using Amazon.Runtime.CredentialManagement;
using Amazon.S3;
var credentialsFile = new SharedCredentialsFile(@"C:\Users\**\.aws\config");
CredentialProfile profile;
if (credentialsFile.TryGetProfile("test", out profile))
{
Console.WriteLine("Profile Region: " + profile.Region.SystemName);
var s3Client = new AmazonS3Client(profile.Region);
Console.WriteLine("Region Endpoint: " + s3Client.Config.RegionEndpoint);
}
Regards, |
@bhoradc ... I believe your understanding is different to what this issue is about.
Keep in mind using the
this.(s)erviceURL = profile.EndpointUrl and similarly this.(r)egionEndpoint = profile.Region .
|
@olfek How are you configuring the SDK to use a specific profile? There a few cases with the .NET SDK doesn't know what profile is being used because it is working with the low level primitives like credentials. In those cases it falls back to looking for configuration with the |
@normj --- I've set the
I'm using https://github.com/localstack/localstack by the way. |
@olfek The SDK either has the |
@normj ---
I'm expecting the ability to use a specific region with LocalStack, configured outside of code, to facilitate multi-region services. |
@olfek As @normj mentioned in #3305 (comment), even if |
@ashishdhingra ...
Which is why I proposed this |
I'm still a bit confused on the intent. Is the goal to have the region set for signing purposes but we don't want to have to change code to set the |
@normj ...
No (at least not from my POV)
& No (at least not from my POV) As a basic user of the SDK, I neither care about "signing" nor the "authentication region" at this point in time. To put it simply, from a basic user POV, I expect the SDK to adhere to ALL config specified in the config file. |
@olfek We do not support SDK with non-AWS solutions. While it works in most scenarios, but it is not guaranteed to work. Our API documentation for ClientConfig explicitly calls out that @normj Please review if we could add something here. Thanks, |
This issue has not received a response in 5 days. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled. |
go away bot |
@olfek Apologies, but we're not planning to change how the SDK handles both I also understand LocalStack mentions multi-region support, but that's not how the vast majority of AWS services work (this is even called out in their documentation: AWS provides individual API endpoints for each region, and typically, resources can only be accessed within their respective regions); the SDKs must know the region when signing requests, this is usually transparent to customers but needs to happen for the request to succeed (which is why Norm recommended the I think if we were designing how |
Comments on closed issues are hard for our team to see. |
@dscpinheiro ...
You could put up a breaking change notice. But would it really be a breaking change? People using this SDK may have done/thought this:
In the case above, the change would be non-breaking, since the If the developer decides to remove the Can you think of any cases where an actual breaking change occurs? |
It could be a breaking change if someone has a) a region set in their Again, I understand this is not the best customer experience when using LocalStack, but we will not change this behavior. |
@dscpinheiro ... In that case, if the
Why won't you? |
Describe the bug
region
set in profile in$HOME/.aws/config
IS NOT loaded in.Expected Behavior
region
set in profile in$HOME/.aws/config
IS loaded in.Current Behavior
region
set in profile, in$HOME/.aws/config
loaded into
Amazon.Runtime.CredentialManagement.CredentialProfile.Region
IS NOT CONSIDERED in
Amazon.Runtime.ClientConfig.get_RegionEndpoint
.Reproduction Steps
N/A
Possible Solution
region
set in profile, in$HOME/.aws/config
loaded into
Amazon.Runtime.CredentialManagement.CredentialProfile.Region
SHOULD BE CONSIDERED in
Amazon.Runtime.ClientConfig.get_RegionEndpoint
.Just like how:
endpoint_url
set in profile, in$HOME/.aws/config
loaded into
Amazon.Runtime.CredentialManagement.CredentialProfile.EndpointUrl
IS CONSIDERED in
Amazon.Runtime.ClientConfig.get_ServiceURL
.Additional Information/Context
N/A
AWS .NET SDK and/or Package version used
3.7.30X.XX
Targeted .NET Platform
.NET 7
Operating System and version
Windows 11
The text was updated successfully, but these errors were encountered: