aws

http://status.aws.amazon.com/ https://www.expeditedssl.com/aws-in-plain-english
kenny 2020-06-24T22:23:48.312500Z

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.

ghadi 2020-06-24T22:25:40.313600Z

Pass arguments

ghadi 2020-06-24T22:26:25.314700Z

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

kenny 2020-06-24T22:26:32.314900Z

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

kenny 2020-06-24T22:27:13.315600Z

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

2020-06-24T22:39:21.316Z

I think the idea is top level defs are bad

✔️ 1
2020-06-24T22:40:03.317Z

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

kenny 2020-06-24T22:56:46.319Z

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.

2020-06-24T23:16:45.319400Z

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

2020-06-24T23:17:22.319900Z

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

2020-06-24T23:17:30.320100Z

-get-info