CLI commands
We can run CLI commands and scripts on AWS Lambda by deploying a “console” function with serverless.yml.
functions:
cli:
handler: the-php-script-to-run.php
runtime: php-84-consoleThe function uses the Console runtime.
To execute the script on Lambda, run the command below:
Bref Cloud
bref commandWe can also pass arguments to the script:
Bref Cloud
bref command "extra command line arguments and options"Our script will be invoked inside AWS Lambda and the result will be printed to the console.
To learn more, read the “Console” guide.
Last updated on