aws-amplify / aws-sdk-ios

AWS SDK for iOS. For more information, see our web site:
https://aws-amplify.github.io/docs
Other
1.68k stars 885 forks source link

Call a lambda function directly from ios /w AWS crendential #4037

Closed joybro closed 2 years ago

joybro commented 2 years ago

State your question According to my understanding, users can assume an authenticated role from Cognito identity pool, and use the role credential to access AWS components. So I think it would be possible to call a lambda function directly from client using aws sdk's lambda interface (like this for web).

But I found aws-amplify doesn't have such an interface to call Lambda. Can anyone confirm if this approach(calling lambda directly from ios) doesn't make sense at all, or it is possible for Javascript, but not for iOS simply because aws-amplify doesn't support it yet?

Which AWS Services are you utilizing? Cognito(UserPool and IdentityPool) and Lambda

Provide code snippets (if applicable)

Environment(please complete the following information):

Device Information (please complete the following information):

royjit commented 2 years ago

Amplify iOS makes it easy for you by handling all the underlying auth and connection. Follow this link to setup AWS Lambda and APIGateway - https://docs.amplify.aws/lib/restapi/getting-started/q/platform/ios/ .

On the other hand if you would like to do this directly with AWS Lambda, use the underlying aws-sdk-ios library - https://github.com/aws-amplify/aws-sdk-ios/tree/main/AWSLambda

joybro commented 2 years ago

@royjit Thank you for the links! aws-sdk-ios seems to be what I was looking for.