We have a setup like this in AWS -
- Step functions include few lambda functions that write to S3 buckets
- S3 bucket is passed as an argument to lambda functions by the user
- API Gateway is setup to invoke Step Functions and IAM Authorization is enabled
However, currently the step function and lambdas are invoked under the IAM role defined, but we want all lambdas to be executed as the authenticated user. So if the user invoking API does not have access to S3 bucket passed, the lambda should fail. How can this be achieved ?