I've recently migrated a local python script to lambda via aws cdk. It collects data from an public api endpoint. On my local machine this function works 100% of the time when it comes to status codes and responses from the api.
When the code is running within the lambda alone its also working fine, 100% of requests are returning with 200.
When the lambda is invoked by an api gateway it will fail with a 403?
EDIT: This is likely very unhelpful for the masses and is basically user error at this point.
In this case my internal lambda logic was causing an occasional malforming to happen one of the parameters within shared scripts.
This caused the 3rd party during processing to inconsistently return 403.
Still unsure why this always worked on local tho....