macpak
macpak

Reputation: 1301

When using AWS .Net SDK, what should be the lifecycle of client objects?

I've an application that queries some of my AWS accounts every few hours. Is it safe (from memory, number of connections perspective) to create a new client object for every request ? As we need to sync almost all of the resource types for almost all of the regions, we end up with hundred clients(number of regions multiplied by resource types) per service run.

Upvotes: 0

Views: 91

Answers (1)

Norm Johanson
Norm Johanson

Reputation: 3177

In general creating the AWS clients are pretty cheap and it is fine to create them and quickly dispose them. The one area I would be careful with when comes to performance is when the SDK has do resolve the credentials like assuming IAM roles to get credentials. It sounds like in your case you are iterating through a bunch of accounts so I'm guessing you are explicitly setting credentials and so that will be okay.

Upvotes: 1

Related Questions