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

respect environment variables same as AWS CLI. #19

Merged
merged 2 commits into from
Sep 28, 2023

Conversation

fujiwara
Copy link
Contributor

Hi. Thank you for the great tool!

stree seems does not look AWS_REGON, AWS_DEFAULT_REGION, and AWS_PROFILE environment variables.
I use these variables normally when using CLI tools for AWS.

So I wrote a patch to set these variables as the default value of CLI parameters.

See also https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html#envvars-list

cmd/root.go Outdated
if p, ok := os.LookupEnv("AWS_PROFILE"); ok {
return p
}
return "local"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

local is the current default value, but the default value of AWS_PROFILE is default in AWS CLI.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fujiwara
Thank you for pointing that out.
The "local" value was something I had used during development and forgot to update. "default" would indeed be the correct value.
Could you please update the value from "local" to "default" and commit the changes again? I will merge your PR once that's done.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fujiwara
Thank you! 💯

@orangekame3 orangekame3 linked an issue Sep 27, 2023 that may be closed by this pull request
@orangekame3 orangekame3 merged commit 436764b into orangekame3:main Sep 28, 2023
1 check passed
@orangekame3 orangekame3 mentioned this pull request Sep 28, 2023
@fujiwara fujiwara deleted the respect_env branch September 28, 2023 08:37
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

Successfully merging this pull request may close these issues.

Support AWS CLI environment variables
2 participants