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.
Pass arguments
Don’t try to make side effects at a distance, like marionettes
Not sure how that'd solve the problem :thinking_face:
There could be dozens of top level def'ed clients. Each one would need to be eval'ed after changing the profile.
I think the idea is top level defs are bad
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
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.
there is https://github.com/cognitect-labs/aws-api/blob/master/src/cognitect/aws/credentials.clj#L48 I am not sure what it would take to call it
I guess you can get the creds provider out of the client using get-info
-get-info