- Newest
- Most votes
- Most comments
Hello.
Will a similar error occur if the user directly invokes Lambda instead of running Lambda with Step Functions?
Also, what kind of code are you using in Lambda?
Looking at the IAM policy, I can't find any problems, so I suspect that the region is incorrectly specified in the Lambda code, causing the error.
You may also be able to see more details by checking "StartIngestionJob" in the CloudTrail event history.
https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events-console.html
Hi,
I would suggest that you call https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sts/client/get_caller_identity.html and log the result just before you try to start the ingestion job.
It will allow you to make sure that you run the Lamdba under the identity that you believe it does. (I have seen cases where the Lambda is running under a role that it has assumed explicitly or not before the faulty API call. In that case, it is different from exec role and may cause the problem)
Best
Didier
Relevant content
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 2 years ago

Hello, thank you for the quick answer,
I have just rechecked, all of:
are in the same region (us-east-1). My lambda should have permissions access to all of these resources.
In the lambda code (called within Step functions), I am using the python3.11 runtime, and the boto3 python SDK to perform the StartIngestionJob operatgion.
I do see the AccessDenied event on CloudTrail but it doesn't seem to offer that much more insights.
I have also checked, and yes, the error still occurs when invoking the lambda directly.
Also rechecked my function code, I do specify the region_name to us-east-1 when instantiating my boto3 clients. Also, the lambda itself runs in us-east-1, so it should not be an issue even if I don't
Can you confirm that the "knowledgeBaseId" and "dataSourceId" specified in the "start_ingestion_job" API are correct? https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/bedrock-agent/client/start_ingestion_job.html
Turns out this was the issue, thank you for the help.
I tracked it down by trying a minimal lambda with the same role and hardcoded knowledge base and data source IDs (it worked), my dynamically resolved IDs were wrong in the other lambda. It seems the error message was off as well. (AccessDenied when it should have been about wrong IDs)