Skip to content

Commit d5cf2f3

Browse files
authored
Enhance Lambda README.md with usage example (#364)
1 parent 6e400e2 commit d5cf2f3

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,24 @@ An API client for Lambda.
1010
```cli
1111
composer require async-aws/lambda
1212
```
13+
14+
## Usage
15+
16+
```cli
17+
export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
18+
export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
19+
```
20+
See [docs/authentication.md](https://github.com/async-aws/aws/blob/master/docs/authentication.md) to see how to authenticate against AWS server.
21+
22+
```php
23+
$client = new LambdaClient([
24+
'region' => 'us-east-1',
25+
]);
26+
27+
$result = $client->invoke([
28+
'FunctionName' => 'app-dev-hello_world', // Find it here: https://console.aws.amazon.com/lambda/home?region=us-east-1#/functions
29+
'Payload' => '{"name": "async-aws/lambda"}',
30+
]);
31+
32+
$result->getPayload(); // hello async-aws/lambda
33+
```

0 commit comments

Comments
 (0)