This is a preview release of the High-level enhancements for AWS in C++, which consists of high-level abstractions
for AWS services in the style of the C++ standard library. Included examples show how to read and write S3
objects using IOStreams, call AWS lambdas in the style of thread functions and demonstrate how STL algorithms
(currently only transform
) can take advantage of AWS Lambda concurrency to speed up an example program
from 15 minutes to 9 seconds.
As an experimental preview release, there are many gaps in coverage that we will fill over time and expect that interfaces will change. Note that this is provided on an AS-IS basis. See Section 7 of LICENSE for more information.
zip
- CMake 3.15+
- AWS SDK for C++ 1.9+
- AWS CLI for uploading the AWS Lambda functions.
- A C++20 compatible compiler. (C++17 may work)
- AWS Lambda Runtime for C++
- TL Expected for
compilers that do not yet support
std::expected
To make changes to the codebase and contribute changes please read our development guide
The installation follows Modern CMake idioms. A quick start script to build and install the projects is below for reference.
The following script assumes the project code was downloaded and the shell is at the project source code directory.
mkdir build
cd build
cmake ..
cmake --build .
cmake --install .
Alternatively, a native installation package can be created using cpack
for distributing to multiple machines after built once.
mkdir build
cd build
cmake ..
cmake --build .
cpack
cpack
will generate a bundle package with the installation artifacts generated by cmake. For example, in MacOS, it creates a awslabs_enhanced_cpp-0.1.0-Darwin.tgz
file that can be expanded in the installation location.
See Quick Tutorial
for usage instructions.
Examples are in the doc/examples
directory.
RAII classes AwsApi
for initializing the API, Logging
for
initializing logging.
The is3stream
and os3stream
libraries can be used to read and
write data in s3
in a similar style to the use of
fstream
to read and write files.
The lambda_client.h
header facilitates
calling lambdas from C++ similarly to other callables. See lambda_add_example.cpp
for a simple example. The central_limit_theorem.cpp
example shows how to use the
transform
function template to take advantage of AWS Lambda's built-in concurrency to efficiently transform an iterator rannge.
The aws_lambda.h
header facilitates
the creation of lambda functions. See lambda_add_fn.cpp
for an
example. To package the lambda function for the cloud, you can
use aws_lambda_package_target
from the AWS Lambda Runtime for
C++ as shown in the CMakeLists.txt
in the examples
directory.
To deploy the lambda function from the CLI, you can use the command
cli_deploy_cpp_lambda lambda_name iam_role zipped_lambda_package
You can also use your preferred Infrastructure as Code technique,and there is an (under development) script for AWS SAM deployment included as well.