-
-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,28 @@ | ||
# CLI commands | ||
|
||
We can run CLI commands and scripts on AWS Lambda by deploying a "console" function with `serverless.yml`. | ||
|
||
```yml | ||
functions: | ||
cli: | ||
handler: the-php-script-to-run.php | ||
runtime: php-81-console | ||
``` | ||
The function uses the [Console runtime](../runtimes/console.mdx). | ||
To execute the script on Lambda, run the command below: | ||
```bash | ||
serverless bref:cli | ||
``` | ||
|
||
We can also pass arguments to the script: | ||
|
||
```bash | ||
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](../runtimes/console.mdx). |