I have three lambda functions as Master, worker1, worker2. I am able to call worker1 from Master. The functions master and worker1 are in the same region whereas the worker2 is in a separate region. When calling worker2 from master the following error returns:
"An error occurred (ResourceNotFoundException) when calling the Invoke operation: Functions from 'us-east-1' are not reachable in this region ('us-west-2')".
Master has an execution role with the below permission:
The code used to invoke worker from master:
def lambda_handler(event, context):
function_name = "arn:aws:lambda:us-east-1-...:function:worker_2"
lambda_client = boto3.client('lambda')
payload = json.dumps({"body-json": "payload string")
response = lambda_client.invoke(
FunctionName = function_name,
Payload = payload
)
response_payload = response['Payload'].read()
response_arr = json.loads(response_payload)
return response_arr['answer']