soto-project / soto

Swift SDK for AWS that works on Linux, macOS and iOS
https://soto.codes
Apache License 2.0
880 stars 83 forks source link

Broken "Using Soto on AWS Lambda" link in the readme #736

Open natanrolnik opened 3 days ago

natanrolnik commented 3 days ago

I was trying to understand if Soto has any special behavior when running in a Lambda - how to configure it, if needed at all.

I found in the Readme, in the Documentation section, a sub-section named User Guides. One of the links there is Using Soto on AWS Lambda. The link there is https://soto.codes/user-guides/using-soto-on-aws-lambda.html, which leads to a 404. In the Soto.codes menu, I found all other items, except for the Lambda one.

Is it missing from the website?

adam-fowler commented 3 days ago

I removed it because the documentation was out of date. I need to update it. There isn't anything too complex about using Soto in a lambda. The main thing you have to do is manage its lifecycle. Call shutdown() on it, when the lambda is done.

natanrolnik commented 3 days ago

Thanks for replying!

But running in Lambda still requires to configure credentials for Soto in one of the described ways, or is there some sort of magic that makes it work out of the box when running in a Lambda environment? Besides managing the lifecycle as you mentioned.

adam-fowler commented 2 days ago

Yeah the original post did have something about that. It is basically use the environment variables supplied to the lambda which are setup to the use the lambda execution role. The default credential provider checks the environment variables first if I remember right so you only need to setup the execution role.

khinkson commented 1 day ago

I removed it because the documentation was out of date. I need to update it. There isn't anything too complex about using Soto in a lambda. The main thing you have to do is manage its lifecycle. Call shutdown() on it, when the lambda is done.

How should the shutdown() be called? I remember seeing in the example a while back and then the examples changed to not having shutdown called before it was removed.