1 Answer
- Newest
- Most votes
- Most comments
3
Hi,
Using AWS_ACCESS_KEY and AWS_SECRET_ACCESS_KEY within a Lambda is not the right way to go: you will get credential mismatches like the one you get because the request that you make is done under the Lambda execution role.
So, the right way is to use only the Lambda execution role after granting it the right credentials for the services that you need.
See https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html
You provide an execution role when you create a function. When you invoke your function,
Lambda automatically provides your function with temporary credentials by assuming this role.
You don't have to call sts:AssumeRole in your function code.
Best,
Didier
Relevant content
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 10 months ago
It worked thank you
For deleting Object it works but when I upload Object it add broken image and also get the same.