ノーコードでクラウド上のデータとの連携を実現。
詳細はこちら →無償トライアル:
無償トライアルへ製品の情報と無償トライアルへ:
Amazon S3 ファイルストレージデータに連携する.NET アプリケーションを素早く、簡単に開発できる便利なドライバー。
加藤龍彦
ウェブデベロッパー
The CData ADO.NET Provider for AmazonS3 enables you to use the Windows Communication Foundation (WCF) framework to rapidly develop service-oriented applications that provide Amazon S3 data to OData consumers. This article shows how to create an entity data model to provide the underlying connectivity to the Amazon S3 data, as well as how to create a WCF Data Service to expose the OData service. You can then consume the feed with any OData client, for example, Power Pivot or an application that uses the CData ADO.NET Provider for OData.
Follow the steps below to create a WCF service application that will provide connectivity to Amazon S3 data via OData.
In the Connection properties dialog, select the CData Amazon S3 Data Source and enter the necessary credentials. A typical connection string is below:
AccessKey=a123;SecretKey=s123;
Amazon S3 リクエストを認可するには、管理者アカウントまたはカスタム権限を持つIAM ユーザーの認証情報を入力します。AccessKey をアクセスキーID に設定します。SecretKey をシークレットアクセスキーに設定します。
Note: AWS アカウント管理者として接続できますが、AWS サービスにアクセスするにはIAM ユーザー認証情報を使用することをお勧めします。
尚、本製品はAmazon S3 のファイルの一覧表示やユーザー管理情報の取得用です。S3 に保管されているExcel、CSV、JSON などのファイル内のデータを読み込みたい場合には、Excel Driver、CSV Driver、JSON Driver をご利用ください。
IAM ユーザーの資格情報を取得するには:
AWS ルートアカウントの資格情報を取得するには:
多くの場合、認証にはAWS ルートユーザーのダイレクトなセキュリティ認証情報ではなく、IAM ロールを使用することをお勧めします。RoleARN を指定することでAWS ロールを代わりに使用できます。これにより、本製品は指定されたロールの資格情報を取得しようと試みます。
(すでにEC2 インスタンスなどで接続されているのではなく)AWS に接続している場合は、ロールを引き受けるIAM ユーザーのAccessKey とSecretKey を追加で指定する必要があります。AWS ルートユーザーのAccessKey および SecretKey を指定する場合、ロールは使用できません。
SSO 認証を必要とするユーザーおよびロールには、RoleARN およびPrincipalArn 接続プロパティを指定してください。各Identity Provider に固有のSSOProperties を指定し、AccessKey とSecretKey を空のままにする必要があります。これにより、本製品は一時的な認証資格情報を取得するために、リクエストでSSO 認証情報を送信します。
See the help documentation for guides to connecting in Visual Studio.
Specify the data source class and configure access to the new WCF Data Service. In the example below, the Access Rule for the entities is set to All. This means that any user will be able to read and modify data.
using System;
using System.Collections.Generic;
using System.Data.Services;
using System.Data.Services.Common;
using System.Linq;
using System.ServiceModel.Web;
using System.Web;
namespace AmazonS3Service{
public class AmazonS3DataService : DataService {
public static void InitializeService(DataServiceConfiguration config) {
config.SetEntitySetAccessRule("*", EntitySetRights.All);
config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
}
}
}
You can now use the service from any OData client; for example, Excel Power Pivot.