Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions cpp/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,27 @@ applicable to utilizing the code examples in this repository.
Building and running the code examples
=============

Additional information geared specifically to understanding the example applications is at
`AWS SDK for C++ Code Examples <https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/programming-services.html>`_.
The example code is organized in subfolders by AWS service.
For example "example_code/s3" contains the Amazon Simple Storage Service (Amazon S3) code examples.

Examples that use multiple services are located in the [example_code/cross-service](example_code/cross-service) folder.

The examples use the CMake build system. Every service subfolder contains a CMakeLists.txt file that builds all the examples for that service.

To understand more about the example applications, see
[Get started with the AWS SDK for C++ code examples](https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/getting-started-code-examples.html).

Hello Service
-----------

Many of the services have a "Hello Service" folder with a starter project and README documentation.
For example, the Amazon S3 Hello project is located at [example_code/s3/hello_s3](example_code/s3/hello_s3).

Docker image (Beta)
===================

This example code will soon be available in a container image
hosted on [Amazon Elastic Container Registry (ECR)](https://docs.aws.amazon.com/AmazonECR/latest/userguide/what-is-ecr.html). This image will be pre-loaded
hosted on [Amazon Elastic Container Registry (ECR)](https://docs.aws.amazon.com/AmazonECR/latest/userguide/what-is-ecr.html). This image will be preloaded
with all C++ examples with dependencies pre-resolved, allowing you to explore
these examples in an isolated environment.

Expand Down
6 changes: 4 additions & 2 deletions cpp/example_code/aurora/hello_aurora/hello_aurora.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
*/
int main(int argc, char **argv) {
Aws::SDKOptions options;
Aws::InitAPI(options);
// Optionally change the log level for debugging.
// options.loggingOptions.logLevel = Utils::Logging::LogLevel::Debug;
Aws::InitAPI(options); // Should only be called once.
int result = 0;
{
Aws::Client::ClientConfiguration clientConfig;
Expand Down Expand Up @@ -65,7 +67,7 @@ int main(int argc, char **argv) {
}
}

Aws::ShutdownAPI(options);
Aws::ShutdownAPI(options); // Should only be called once.
return 0;
}
// snippet-end:[cpp.example_code.aurora.hello_aurora]
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@

int main(int argc, char **argv) {
Aws::SDKOptions options;
Aws::InitAPI(options);
// Optionally change the log level for debugging.
// options.loggingOptions.logLevel = Utils::Logging::LogLevel::Debug;
Aws::InitAPI(options); // Should only be called once.
int result = 0;
{
Aws::Client::ClientConfiguration clientConfig;
Expand Down Expand Up @@ -75,7 +77,7 @@ int main(int argc, char **argv) {
}


Aws::ShutdownAPI(options);
Aws::ShutdownAPI(options); // Should only be called once.
return result;
}
// snippet-end:[cpp.example_code.autoscaling.hello_autoscaling]
6 changes: 4 additions & 2 deletions cpp/example_code/cognito/hello_cognito/hello_cognito.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@

int main(int argc, char **argv) {
Aws::SDKOptions options;
Aws::InitAPI(options);
// Optionally change the log level for debugging.
// options.loggingOptions.logLevel = Utils::Logging::LogLevel::Debug;
Aws::InitAPI(options); // Should only be called once.
int result = 0;
{
Aws::Client::ClientConfiguration clientConfig;
Expand Down Expand Up @@ -71,7 +73,7 @@ int main(int argc, char **argv) {
}
}

Aws::ShutdownAPI(options);
Aws::ShutdownAPI(options); // Should only be called once.
return result;
}
// snippet-end:[cpp.example_code.cognito.hello_cognito]
6 changes: 4 additions & 2 deletions cpp/example_code/dynamodb/hello_dynamodb/hello_dynamodb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@

int main(int argc, char **argv) {
Aws::SDKOptions options;
Aws::InitAPI(options);
// Optionally change the log level for debugging.
// options.loggingOptions.logLevel = Utils::Logging::LogLevel::Debug;
Aws::InitAPI(options); // Should only be called once.

int result = 0;
{
Expand Down Expand Up @@ -60,7 +62,7 @@ int main(int argc, char **argv) {
}


Aws::ShutdownAPI(options);
Aws::ShutdownAPI(options); // Should only be called once.
return result;
}
// snippet-end:[cpp.example_code.dynamodb.hello_dynamodb]
6 changes: 4 additions & 2 deletions cpp/example_code/ec2/hello_ec2/hello_ec2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@

int main(int argc, char **argv) {
Aws::SDKOptions options;
Aws::InitAPI(options);
// Optionally change the log level for debugging.
// options.loggingOptions.logLevel = Utils::Logging::LogLevel::Debug;
Aws::InitAPI(options); // Should only be called once.
int result = 0;
{
Aws::Client::ClientConfiguration clientConfig;
Expand Down Expand Up @@ -108,7 +110,7 @@ int main(int argc, char **argv) {
}


Aws::ShutdownAPI(options);
Aws::ShutdownAPI(options); // Should only be called once.
return result;
}
// snippet-end:[cpp.example_code.ec2.hello_ec2]
6 changes: 4 additions & 2 deletions cpp/example_code/glue/hello_glue/hello_glue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@

int main(int argc, char **argv) {
Aws::SDKOptions options;
Aws::InitAPI(options);
// Optionally change the log level for debugging.
// options.loggingOptions.logLevel = Utils::Logging::LogLevel::Debug;
Aws::InitAPI(options); // Should only be called once.
int result = 0;
{
Aws::Client::ClientConfiguration clientConfig;
Expand Down Expand Up @@ -70,7 +72,7 @@ int main(int argc, char **argv) {
std::cout << " " << i + 1 << ". " << jobs[i] << std::endl;
}
}
Aws::ShutdownAPI(options);
Aws::ShutdownAPI(options); // Should only be called once.
return result;
}
// snippet-end:[cpp.example_code.glue.hello_glue]
6 changes: 4 additions & 2 deletions cpp/example_code/iam/hello_iam/hello_iam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@

int main(int argc, char **argv) {
Aws::SDKOptions options;
Aws::InitAPI(options);
// Optionally change the log level for debugging.
// options.loggingOptions.logLevel = Utils::Logging::LogLevel::Debug;
Aws::InitAPI(options); // Should only be called once.
int result = 0;
{
const Aws::String DATE_FORMAT("%Y-%m-%d");
Expand Down Expand Up @@ -79,7 +81,7 @@ int main(int argc, char **argv) {
}


Aws::ShutdownAPI(options);
Aws::ShutdownAPI(options); // Should only be called once.
return result;
}
// snippet-end:[cpp.example_code.iam.hello_iam]
6 changes: 4 additions & 2 deletions cpp/example_code/lambda/hello_lambda/hello_lambda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@

int main(int argc, char **argv) {
Aws::SDKOptions options;
Aws::InitAPI(options);
// Optionally change the log level for debugging.
// options.loggingOptions.logLevel = Utils::Logging::LogLevel::Debug;
Aws::InitAPI(options); // Should only be called once.
int result = 0;
{
Aws::Client::ClientConfiguration clientConfig;
Expand Down Expand Up @@ -75,7 +77,7 @@ int main(int argc, char **argv) {
}


Aws::ShutdownAPI(options);
Aws::ShutdownAPI(options); // Should only be called once.
return result;
}
// snippet-end:[cpp.example_code.lambda.hello_lambda]
6 changes: 4 additions & 2 deletions cpp/example_code/rds/hello_rds/hello_rds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@

int main(int argc, char **argv) {
Aws::SDKOptions options;
Aws::InitAPI(options);
// Optionally change the log level for debugging.
// options.loggingOptions.logLevel = Utils::Logging::LogLevel::Debug;
Aws::InitAPI(options); // Should only be called once.
int result = 0;
{
Aws::Client::ClientConfiguration clientConfig;
Expand Down Expand Up @@ -70,7 +72,7 @@ int main(int argc, char **argv) {
}
}

Aws::ShutdownAPI(options);
Aws::ShutdownAPI(options); // Should only be called once.
return result;
}
// snippet-end:[cpp.example_code.rds.hello_rds]
6 changes: 4 additions & 2 deletions cpp/example_code/s3/hello_s3/hello_s3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@

int main(int argc, char **argv) {
Aws::SDKOptions options;
Aws::InitAPI(options);
// Optionally change the log level for debugging.
// options.loggingOptions.logLevel = Utils::Logging::LogLevel::Debug;
Aws::InitAPI(options); // Should only be called once.
int result = 0;
{
Aws::Client::ClientConfiguration clientConfig;
Expand All @@ -50,7 +52,7 @@ int main(int argc, char **argv) {
}
}

Aws::ShutdownAPI(options);
Aws::ShutdownAPI(options); // Should only be called once.
return result;
}
// snippet-end:[cpp.example_code.s3.hello_s3]
6 changes: 4 additions & 2 deletions cpp/example_code/sns/hello_sns/hello_sns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@

int main(int argc, char **argv) {
Aws::SDKOptions options;
Aws::InitAPI(options);
// Optionally change the log level for debugging.
// options.loggingOptions.logLevel = Utils::Logging::LogLevel::Debug;
Aws::InitAPI(options); // Should only be called once.
{
Aws::Client::ClientConfiguration clientConfig;
// Optional: Set to the AWS Region (overrides config file).
Expand Down Expand Up @@ -79,7 +81,7 @@ int main(int argc, char **argv) {
}


Aws::ShutdownAPI(options);
Aws::ShutdownAPI(options); // Should only be called once.
return 0;
}
// snippet-end:[cpp.example_code.sns.hello_sns]
6 changes: 4 additions & 2 deletions cpp/example_code/sqs/hello_sqs/hello_sqs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@

int main(int argc, char **argv) {
Aws::SDKOptions options;
Aws::InitAPI(options);
// Optionally change the log level for debugging.
// options.loggingOptions.logLevel = Utils::Logging::LogLevel::Debug;
Aws::InitAPI(options); // Should only be called once.
{
Aws::Client::ClientConfiguration clientConfig;
// Optional: Set to the AWS Region (overrides config file).
Expand Down Expand Up @@ -73,7 +75,7 @@ int main(int argc, char **argv) {
}
}

Aws::ShutdownAPI(options);
Aws::ShutdownAPI(options); // Should only be called once.
return 0;
}
// snippet-end:[cpp.example_code.sqs.hello_sqs]