Skip to content

Commit c3c305c

Browse files
SNOW-2359496 Add additional ways to infer the default AWS Region (#1266)
Co-authored-by: Timo Vink <[email protected]>
1 parent c667aa6 commit c3c305c

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- v5.1.0
55
- Added `APPLICATION_PATH` to `CLIENT_ENVIRONMENT` sent during authentication to identify the application connecting to Snowflake.
66
- Renew idle sessions in the pool if keep alive is enabled.
7+
- AWS WIF will now also check the application config and AWS profile credential store when determining the current AWS region
78
- v5.0.0
89
- Disabled CRL checks by default.
910
- Added support for alternative, memory efficient and thread safe CRL (Certificate Revocation List) checks.

Snowflake.Data/Core/Authenticator/WorkflowIdentity/AwsSdkWrapper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ public virtual ImmutableCredentials GetAwsCredentials() =>
1010
FallbackCredentialsFactory.GetCredentials()?.GetCredentials();
1111

1212
public virtual string GetAwsRegion() =>
13-
Amazon.Util.EC2InstanceMetadata.Region?.SystemName;
13+
FallbackRegionFactory.GetRegionEndpoint()?.SystemName;
1414
}
1515
}

Snowflake.Data/Core/Authenticator/WorkflowIdentity/WorkflowIdentityAwsAttestationRetriever.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,6 @@ private ImmutableCredentials GetAwsCredentials()
8888

8989
private string GetAwsRegion()
9090
{
91-
var regionFromEnv = _environmentOperations.GetEnvironmentVariable("AWS_REGION");
92-
if (!string.IsNullOrEmpty(regionFromEnv))
93-
{
94-
return regionFromEnv;
95-
}
9691
var region = _awsSdkWrapper.GetAwsRegion();
9792
if (string.IsNullOrEmpty(region))
9893
{

0 commit comments

Comments
 (0)