-
Notifications
You must be signed in to change notification settings - Fork 224
Suggestion: Write env output to aws credentials file #189
Comments
I think a different command to That said, I feel like this can be accomplished with a pretty simple shell script:
Maybe with a few more thumbs up I'd feel better about it |
I feel a more appropriate use of time, especially consider the perceived use case, would be an example of how to use this within another program. |
Yeah if we could write it into a credentials file as a profile would be awesome! |
@nickatsegment The bash script is a good suggestion. I'm going to make use of it in a form of an alias that takes care of the logic 😄 In addition to just writing out the AWS env info to the credentials file, it would really be ideal if the [profile] information is kept up to date on consecutive runs of the command instead of just being piped to the file. |
@fpmoles Lots of cli utilities can use |
I don't want users to have access to aws outside of okta, so the profile pattern doesn't work in that use case. When writing ops scripts, especially in languages like go, having a way to integrate easily is critical, hence my comment. Today we end up using bash scripts so we can leverage this wonderful tool, but having the ability to use the guts of this tool easily with scripts written in golang would be amazing, and it really is just digging through the code and figuring it out. That being said, someone who knows the tool could probably shoot that out much faster. |
Already users can use
I don't think that having an export command would prevent any of these use cases. |
Yeah as large environment we use multiple accounts. Having aws profile gives us flexibility on running terraform per account simultaneously. |
Considering this functionality is totally doable with various scripting approaches, I would probably not include it in |
Yep, I see this limitation. Updating the INI with bash and friends reliably would probably be tough, but I bet this would be a python one-liner.
As jbialy mentioned, you can use
Not really clear on how this is different to something like |
We have ran into these situations in our environment. This is a good point! Using BTW, thanks for creating this utility, it's really awesome! |
@jbialy I have written quick wrapper gist for this if you would like to try out: https://gist.github.com/bazimov/834d7457c4653bea24458586216c4e75 |
Thanks for putting this together. I will give it a try! 👍 |
Would you consider accepting a PR for this feature? I've unfortunately got a use case that doesn't seem to be handled by any of the work-arounds. We have some ansible scripts that use multiple AWS profiles (artifacts are stored in a different aws account, so we need to use two accounts simultaneously to deploy). As a result, we can't just call Moreover, the bash script to append to the credentials file doesn't work very well because it only works once. Once your token expires and you append to the file again, the file is invalid because there are two entries for a single profile in the credentials file. |
AWS-okta support the
env
command which prints the export commands that can be used to set AWS environment vars. I think that it would also be useful to have an option that appends the access, secret and token values to~/.aws/credentials
under a given [profile]?Perhaps something like:
What are your thought about this?
The text was updated successfully, but these errors were encountered: