To execute tests in multiple regions, workers are added in the form of Lambda function.
To add a new lambda function:
- Create a lambda function in the desired location (convention is to call it
rapidapi_testing_local_worker
). Follow default settings. - Add environment variables (URL, KEY and LOCATION).
- Update the functions Handler setting to:
worker_dist/server/worker.handler
. - Configure function timeout to
10 mins
. - Add function to the "package_worker.sh" script. Make sure to update both the ARN -
--function-name
and the Region ---region
in the line. - Run the package-worker.sh script (
./package_worker.sh
) to deploy code. Refresh lambda editor and validate that the code was deployed. - Create CloudWatch (
CloudWatch Events / Event Bridge
) trigger for the function with a new rule: name=EveryMinute
scheduleExpression=rate(1 minute)
. Make sureEnable Trigger
is selected. - Run a test with the region as it's target to verify it was deployed correctly.