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

Config file path command line argument #305

Open
carlosreyna-plated opened this issue Jun 4, 2019 · 3 comments
Open

Config file path command line argument #305

carlosreyna-plated opened this issue Jun 4, 2019 · 3 comments

Comments

@carlosreyna-plated
Copy link

Is your feature request related to a problem? Please describe.
We have multiple AWS accounts we interact with and would like to be able to specify a config.properties file through a command line argument.

Describe the solution you'd like
Something like the example below.

java -jar ~/.okta/okta-aws-cli-2.0.0.jar --config=~/aws1-config.properties <command> <args>

Describe alternatives you've considered
We are open to options on how to specify configuration files.

@junkangli
Copy link
Contributor

Since the issue raised is basically regarding support of multiple AWS accounts, you may want to discuss it in #304.

@carlosreyna-plated
Copy link
Author

Since the issue raised is basically regarding support of multiple AWS accounts, you may want to discuss it in #304.

Looked at it and it is a painful workaround. I strong believe this is a better approach. It would allow users to select different OKTA accounts and configurations without modifying their file repeatedly. It is also something that should be simple to achieve.

@jeremyplichtafc
Copy link
Contributor

jeremyplichtafc commented Aug 23, 2019

With #331 which was just released in v2.0.4 it will now load ~/.okta/config.properties then ~/.okta/config.${OKTA_PROFILE}.properties.

So for example. Say you had a "stage" environment you wanted to load. You would put your common properties in ~/.okta/config.properties, then make a file with properties specific to your stage account in ~/.okta/config.stage.properties and run:

okta-aws stage s3 ls

this is equivalent to also running
OKTA_PROFILE=stage java -Djava.util.logging.config.file=~/.okta/logging.properties -classpath ~/.okta/okta-aws-cli.jar com.okta.tools.WithOkta aws --profile stage s3 ls

Can you give this a shot in latest release and let us know if it works for you?

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