Closed jsmartt closed 7 years ago
Also, it should use the environment variables that the SDK defines; so a user may never have to define a client in their code.
I think the ENV variables may not be safest and not the simplest option for storing multiple clients. The main use case we came up for the client's use was storing and retrieving them from databags. The client is just exposed in the examples for demonstration purposes.
Well, you'd only be able to use the ENV variables for a single default client. Anything else would need to use another method. I think we can still recommend using a secure method like an encrypted databag or secrets management solution (e.g., Hashicorp Vault). What I'm trying to accomplish with ENV variables is a consistent pattern in both the SDK and the cookbook. If we do this, we'll also make it much easier for people to run the examples, and we can even use the examples internally as more of an integration test.
Scenario/Intent
I'd like to be able to set the client object once and then all resources that don't set the client property will use that as a default.
Environment Details
Steps to Reproduce
[If you are filing an issue, what are the things we need to do in order to reproduce your problem? How are you using this cookbook or any resources it includes?]
Expected Result
Set the client object once and everything that doesn't override it will use that as a default.
Actual Result
You have to pass in a client object for EVERY resource