概要
AWS SDK for C++は、Amazon Web Services (AWS) 向けのモダンなC++ 11以降のインターフェースを提供するSDKである。
ほぼ全てのAWS機能に対して高レベルAPIと低レベルAPIの両方を提供しており、依存関係を最小限に抑えながら、Windows、MacOS、Linux、モバイルでのプラットフォーム移植性を実現している。
パフォーマンスを重視して設計されており、低レベルと高レベルの両方のSDKを完全に機能させながら、依存関係を最小限に抑えている。
300以上のAWSサービスに対応しており、コンピューティング (EC2、Lambda、ECS等)、ストレージ (S3、EBS、Glacier等)、データベース (DynamoDB、RDS、Redshift等)、
機械学習 (SageMaker、Bedrock、Rekognition等) などの主要なサービスが含まれている。
Standard Template Library (STL) との連携、C++11機能の使用とサポート、例外安全性、広範囲で設定可能なロギング、デフォルトの認証情報プロバイダー等の特徴がある。
AWS SDK for C++は現在General Availability (一般提供) で、本番環境での使用が推奨されている。
AWS SDK for C++のインストール
RHEL、SUSE、Debianの標準パッケージ管理システムからAWS SDK for C++を直接インストールすることは公式にはサポートされていない。
そのため、ソースコードからAWS SDK for C++をインストールすることが推奨される。
- システム要件
- 4[GB]以上のRAMが必要となるため、t2.micro、t2.small等の小さいEC2インスタンスではメモリ不足でビルドが失敗する可能性がある。
- 必要なコンパイラ
- Visual Studio 2015以降
- GCC 4.9以降
- Clang 3.3以降
Linux
AWS SDK for C++のビルドに必要なライブラリをインストールする。
# RHEL sudo dnf install libcurl-devel openssl-devel libuuid-devel pulseaudio-libs-devel # SUSE sudo zypper install zlib-devel libcurl-devel libopenssl-devel libopenssl-3-devel # Debian sudo apt install cmake libcurl4-openssl-dev libssl-dev uuid-dev zlib1g-dev libpulse-dev
AWS SDK for C++のソースコードをダウンロードする。
git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp cd aws-sdk-cpp
AWS SDK for C++をビルドおよびインストールする。
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=<AWS SDK for C++のインストールディレクトリ> \
-DBUILD_ONLY="dynamodb;s3;lambda" \ # DynamoDB, S3, Lambdaのみを使用する場合
..
make -j $(nproc)
make install
Windows
vcpkgパッケージマネージャは外部コントリビューターによって管理されているパッケージマネージャであり、AWSから直接提供されているものではない。
vcpkgパッケージマネージャをインストールする。
git clone https://github.com/Microsoft/vcpkg.git cd vcpkg ./bootstrap-vcpkg.sh ./vcpkg integrate install
AWS SDK for C++をインストールする。
./vcpkg install aws-sdk-cpp
BUILD_ONLYオプション
| カテゴリ | BUILD_ONLYパラメータ | サービス名 |
|---|---|---|
| コンピューティング系 | ec2 | Amazon EC2 |
| ecs | Amazon ECS | |
| eks | Amazon EKS | |
| lambda | AWS Lambda | |
| batch | AWS Batch | |
| lightsail | Amazon Lightsail | |
| ストレージ系 | s3 | Amazon S3 |
| s3-crt | Amazon S3 (CRT client) | |
| glacier | Amazon Glacier | |
| ebs | Amazon EBS | |
| fsx | Amazon FSx | |
| storage-gateway | AWS Storage Gateway | |
| データベース系 | dynamodb | Amazon DynamoDB |
| rds | Amazon RDS | |
| redshift | Amazon Redshift | |
| neptune | Amazon Neptune | |
| docdb | Amazon DocumentDB | |
| timestream-write | Amazon Timestream (書き込み) | |
| timestream-query | Amazon Timestream (クエリ) | |
| 分析系 | athena | Amazon Athena |
| emr | Amazon EMR | |
| kinesis | Amazon Kinesis | |
| kinesis-analytics | Amazon Kinesis Analytics | |
| glue | AWS Glue | |
| quicksight | Amazon QuickSight | |
| 機械学習・AI系 | sagemaker | Amazon SageMaker |
| rekognition | Amazon Rekognition | |
| comprehend | Amazon Comprehend | |
| translate | Amazon Translate | |
| transcribe | Amazon Transcribe | |
| polly | Amazon Polly | |
| lex | Amazon Lex | |
| bedrock | Amazon Bedrock | |
| bedrock-runtime | Amazon Bedrock Runtime | |
| ネットワーク・配信系 | cloudfront | Amazon CloudFront |
| route53 | Amazon Route 53 | |
| elb | Elastic Load Balancing | |
| elasticloadbalancing | Elastic Load Balancing | |
| elbv2 | Elastic Load Balancing v2 | |
| elasticloadbalancingv2 | Elastic Load Balancing v2 | |
| apigateway | Amazon API Gateway | |
| directconnect | AWS Direct Connect | |
| セキュリティ・認証系 | iam | AWS IAM |
| cognito-identity | Amazon Cognito Identity | |
| cognito-idp | Amazon Cognito Identity Provider | |
| kms | AWS KMS | |
| secretsmanager | AWS Secrets Manager | |
| acm | AWS Certificate Manager | |
| guardduty | Amazon GuardDuty | |
| inspector | Amazon Inspector | |
| 管理・監視系 | cloudwatch | Amazon CloudWatch |
| cloudwatch-logs | Amazon CloudWatch Logs | |
| cloudtrail | AWS CloudTrail | |
| config | AWS Config | |
| organizations | AWS Organizations | |
| cloudformation | AWS CloudFormation | |
| ssm | AWS Systems Manager | |
| メッセージング系 | sqs | Amazon SQS |
| sns | Amazon SNS | |
| ses | Amazon SES | |
| pinpoint | Amazon Pinpoint | |
| eventbridge | Amazon EventBridge | |
| 統合・ワークフロー系 | stepfunctions | AWS Step Functions |
| swf | Amazon SWF | |
| mq | Amazon MQ | |
| その他 | iot | AWS IoT |
| greengrass | AWS Greengrass | |
| mediaconvert | AWS Elemental MediaConvert | |
| elastictranscoder | Amazon Elastic Transcoder |
上記は主要なサービスのリストであるが、実際には300以上のサービスがサポートされている。
そのため、最新の完全なリストは、GitHubリポジトリで直接確認することを推奨する。
- サービス名の完全なリストを取得する方法
- AWS SDK for C++おソースコードをダウンロードする。
git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp
- サービス名の一覧を表示する。
cd aws-sdk-cpp ls -d aws-cpp-sdk-* | sed 's/aws-cpp-sdk-//' | sort
- vcpkg (Windows) を使用して利用可能な全ての機能を確認する場合
vcpkg search aws-sdk-cpp