Skip to content

Commit 420a370

Browse files
Fix docs for current AWS CLI and current AWS Lambda runtimes
* provided has to be either provided.al2023 or provided.al2 * AWS CLI2 has changed the param format * add docs about building on arm64
1 parent 934d254 commit 420a370

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,15 @@ And finally, create the Lambda function:
130130
```
131131
$ aws lambda create-function --function-name demo \
132132
--role <specify role arn from previous step here> \
133-
--runtime provided --timeout 15 --memory-size 128 \
133+
--runtime provided.al2023 --timeout 15 --memory-size 128 \
134134
--handler demo --zip-file fileb://demo.zip
135135
```
136+
> **N.B.** If you are building on `arm64`, you have to explicitly add the param `--architectures arm64`, so that you are setting up the proper architecture on AWS to run your supplied Lambda function.
136137
137138
And to invoke the function:
138139
```bash
139-
$ aws lambda invoke --function-name demo --payload '{"answer":42}' output.txt
140+
$ aws lambda invoke --function-name demo --cli-binary-format raw-in-base64-out --payload '{"answer":42}' output.txt
141+
```
140142
```
141143
142144
## Using the C++ SDK for AWS with this runtime
@@ -150,7 +152,7 @@ Any *fully* compliant C++11 compiler targeting GNU/Linux x86-64 should work. Ple
150152
- Use Clang v3.3 or above
151153
152154
## Packaging, ABI, GNU C Library, Oh My!
153-
Lambda runs your code on some version of Amazon Linux. It would be a less than ideal customer experience if you are forced to build your application on that platform and that platform only.
155+
Lambda runs your code on some version of Amazon Linux. It would be a less than ideal customer experience if you are forced to build your application on that platform and that platform only.
154156
155157
However, the freedom to build on any linux distro brings a challenge. The GNU C Library ABI. There is no guarantee the platform used to build the Lambda function has the same GLIBC version as the one used by AWS Lambda. In fact, you might not even be using GNU's implementation. For example you could build a C++ Lambda function using musl libc.
156158
@@ -196,10 +198,12 @@ curl_easy_setopt(curl_handle, CURLOPT_CAINFO, "/etc/pki/tls/certs/ca-bundle.crt"
196198
```bash
197199
$ aws lambda create-function --function-name demo \
198200
--role <specify role arn here> \
199-
--runtime provided --timeout 15 --memory-size 128 \
201+
--runtime provided.al2023 --timeout 15 --memory-size 128 \
200202
--handler demo
201203
--code "S3Bucket=mys3bucket,S3Key=demo.zip"
202204
```
205+
> **N.B.** See hint above if you are building on `arm64`.
206+
203207
1. **My code is crashing, how can I debug it?**
204208
205209
- Starting with [v0.2.0](https://github.com/awslabs/aws-lambda-cpp/releases/tag/v0.2.0) you should see a stack-trace of the crash site in the logs (which are typically stored in CloudWatch).

0 commit comments

Comments
 (0)