-
-
Save minedun6/80c0235526a1f2f987494b739bba871d to your computer and use it in GitHub Desktop.
Invoke sample Lambda function through PHP
This file contains hidden or 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
<?php | |
require_once __DIR__.'/vendor/autoload.php'; | |
use Aws\Lambda\LambdaClient; | |
$client = LambdaClient::factory([ | |
'version' => 'latest', | |
// The region where you have created your Lambda | |
'region' => 'eu-west-1', | |
]); | |
$result = $client->invoke([ | |
// The name your created Lamda function | |
'FunctionName' => 'hello-world', | |
]); | |
echo json_decode((string) $result->get('Payload')); | |
// You'll now see "Hello, World! in your output" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment