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

Set "AWS_REGION" env variable as well as "AWS_DEFAULT_REGION" #15

Open
chang12 opened this issue Sep 11, 2018 · 4 comments
Open

Set "AWS_REGION" env variable as well as "AWS_DEFAULT_REGION" #15

chang12 opened this issue Sep 11, 2018 · 4 comments

Comments

@chang12
Copy link

chang12 commented Sep 11, 2018

It seems name of environment variable for aws region is different with aws-java-sdk

https://github.com/aws/aws-sdk-java/blob/master/aws-java-sdk-core/src/main/java/com/amazonaws/SDKGlobalConfiguration.java#L254

@ktilcu
Copy link
Contributor

ktilcu commented Sep 11, 2018

Is there a particular problem you are running into?

@chang12 chang12 changed the title AWS_DEFAULT_REGION -> AWS_REGION Set "AWS_REGION" env variable as well as "AWS_DEFAULT_REGION" Sep 12, 2018
@chang12
Copy link
Author

chang12 commented Sep 12, 2018

I've running gradle task cascaded by awsudo.
e.g. awsudo -u profile_name ./gradlew ...

I expect that region written in ~/.aws/config is applied to aws-java-sdk, but it's not.

So I think it will be better awsudo set AWS_REGION too, which is used by aws-java-sdk.

@asmgf
Copy link

asmgf commented Dec 24, 2018

An example of functionality that needs AWS_REGION set may be CloudWatchLogs:

const Aws = require('aws-sdk');

new Aws.CloudWatchLogs().describeLogGroups({}, (err, details) => {
  if (err) {
    console.error(err);
  } else {
    console.log(details);
  }
});

If launched as awsudo node index.js it fails with ConfigError: Missing region in config.
But AWS_REGION=us-east-1 node index.js works fine.

@ktilcu
Copy link
Contributor

ktilcu commented Dec 27, 2018

Cool!. Let me look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants