I have Lambda function that executes in minimum 12 seconds so I can't expose it via AWS API Gateway (because of 10 sec timeout). What I was thinking is to call/execute Lambda function directly from frontend through AWS javascript SDK. Is it safe to create IAM user that will have only permission to execute this one particular function and hardcode this user AWS_KEY_ID and AWS_SECRET_KEY in frontend?
Yes it is possible.
New AWS Service Cognito allows you to provide AWS creds specific to the end user. You can use those creds to access different aws services like DynamoDB
or in your case AWS Lambda
.
Is it safe to create IAM user that will have only permission to execute this one particular function and hardcode this user AWS_KEY_ID and AWS_SECRET_KEY in frontend?
Never do do this. Use AWS Service Cognito instead.
You can use Amazon Gateway API's to connect from so called "front end" to lambda, checkout this tutorial from amazon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With