Fork me on GitHub
#aws
<
2020-06-24
>
kenny22:06:48

Curious if anyone has thought about how one would dynamically change the AWS profile from the REPL for aws-api. We have some "default" clients def 'ed in many locations. I can dynamically change the aws.profile Java prop but, afaict, there's no way to bust the creds cache on all those def'ed clients. The use case for changing profiles seems common enough -- I'd like to have my REPL running for a while and switch between my "dev" and "prod" aws profiles.

ghadi22:06:40

Pass arguments

ghadi22:06:25

Don’t try to make side effects at a distance, like marionettes

kenny22:06:32

Not sure how that'd solve the problem :thinking_face:

kenny22:06:13

There could be dozens of top level def'ed clients. Each one would need to be eval'ed after changing the profile.

hiredman22:06:21

I think the idea is top level defs are bad

✔️ 1
hiredman22:06:03

you should pass around clients as arguments, so if you want new ones with different credentials you can create new ones and pass those around to your functions

kenny22:06:46

Totally agree. We have a lot of old code that would require a decent amount of eng resources to change to not be top-level def'ed. It'd be great to do at some point... Was trying to see if there was some sort of short-term solution to this.

hiredman23:06:22

I guess you can get the creds provider out of the client using get-info