diff --git a/google/internal/externalaccount/aws.go b/google/internal/externalaccount/aws.go index 2f078f7..554c8f8 100644 --- a/google/internal/externalaccount/aws.go +++ b/google/internal/externalaccount/aws.go @@ -341,6 +341,8 @@ func (cs awsCredentialSource) subjectToken() (string, error) { func (cs *awsCredentialSource) getRegion() (string, error) { if envAwsRegion := getenv("AWS_REGION"); envAwsRegion != "" { return envAwsRegion, nil + } else if envAwsRegion := getenv("AWS_DEFAULT_REGION"); envAwsRegion != "" { + return envAwsRegion, nil } if cs.RegionURL == "" { diff --git a/google/internal/externalaccount/urlcredsource_test.go b/google/internal/externalaccount/urlcredsource_test.go index 8ade2a2..6a36d0d 100644 --- a/google/internal/externalaccount/urlcredsource_test.go +++ b/google/internal/externalaccount/urlcredsource_test.go @@ -7,7 +7,6 @@ package externalaccount import ( "context" "encoding/json" - "fmt" "net/http" "net/http/httptest" "testing" @@ -20,7 +19,6 @@ func TestRetrieveURLSubjectToken_Text(t *testing.T) { if r.Method != "GET" { t.Errorf("Unexpected request method, %v is found", r.Method) } - fmt.Println(r.Header) if r.Header.Get("Metadata") != "True" { t.Errorf("Metadata header not properly included.") }