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:
Serverless CLI
serverless bref:cliWe can also pass arguments to the script:
Serverless CLI
serverless bref:cli --args="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