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

AWS_DEFAULT_REGION environment variable not being read. #2589

Closed
aaronolds opened this issue Apr 24, 2023 · 3 comments
Closed

AWS_DEFAULT_REGION environment variable not being read. #2589

aaronolds opened this issue Apr 24, 2023 · 3 comments
Labels
bug This issue is a bug. module/sdk-core needs-review p2 This is a standard priority issue queued xs Effort estimation: tiny

Comments

@aaronolds
Copy link

Describe the bug

When calling the EnvironmentVariableAWSRegion, the code is only looking at AWS_REGION it should also look at AWS_DEFAULT_REGION as well.

Expected Behavior

The code should look at both environment variables AWS_DEFAULT_REGION and AWS_REGION

Current Behavior

The code only looks at AWS_REGION environment variable

Reproduction Steps

Remove AWS_REGION environment variable and add AWS_DEFAULT_REGION environment variable. Then try to instantiate an AmazonServiceClient.

Possible Solution

If the AWS_REGION environment variable is not set check the AWS_DEFAULT_REGION environment variable before throwing exception.

Additional Information/Context

No response

AWS .NET SDK and/or Package version used

AWSSDK.Core -Version 3.7.106.24

Targeted .NET Platform

.NET 6, .NET 7

Operating System and version

ALL

@aaronolds aaronolds added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Apr 24, 2023
@ashishdhingra
Copy link
Contributor

Per Environment variables to configure the AWS CLI, AWS_DEFAULT_REGION identifies the AWS Region whose servers you want to send your requests to by default.

The constant ENVIRONMENT_VARIABLE_DEFAULT_REGION was added in commit 3d41f4b as part of adding support for Default Configuration Modes. This needs review with the team since the utility class EnvironmentVariableAWSRegion hasn't changed in years and the new constant was introduced when adding support for default configuration mode. Needs review with the team.

@ashishdhingra ashishdhingra added p1 This is a high priority issue module/sdk-core needs-review and removed needs-triage This issue or PR still needs to be triaged. labels Apr 24, 2023
@ashishdhingra ashishdhingra added p2 This is a standard priority issue xs Effort estimation: tiny queued and removed p1 This is a high priority issue needs-review labels May 5, 2023
@dscpinheiro
Copy link
Contributor

Hi @aaronolds, I'm going to resolve this as not planned.

AWS_DEFAULT_REGION is a variable the previous version of the CLI (V1) used, but all other SDKs have standardized on using AWS_REGION instead: https://docs.aws.amazon.com/sdkref/latest/guide/feature-region.html (including the CLI V2: AWS CLI v2 uses any value in AWS_REGION before any value in AWS_DEFAULT_REGION).

@dscpinheiro dscpinheiro closed this as not planned Won't fix, can't repro, duplicate, stale Aug 30, 2024
Copy link

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. module/sdk-core needs-review p2 This is a standard priority issue queued xs Effort estimation: tiny
Projects
None yet
Development

No branches or pull requests

3 participants