Easily push SQL Server data to Amazon Athena using the CData SSIS Tasks for Amazon Athena.
SQL Server databases are commonly used to store enterprise records. It is often necessary to move this data to other locations. The CData SSIS Task for Amazon Athena allows you to easily transfer Amazon Athena data. In this article you will export data from SQL Server to Amazon Athena.
Add Source and Destination Components
To get started, add a new ADO.NET Source control and a new Amazon Athena Destination control to the data flow task.

Configure the ADO.NET Source
Follow the steps below to specify properties required to connect to the SQL Server instance.
- Open the ADO.NET Source and add a new connection. Enter your server and database information here.
- In the Data access mode menu, select "Table or view" and select the table or view to export into Amazon Athena.
- Close the ADO NET Source wizard and connect it to the destination component.
Create a New Connection Manager for Amazon Athena
Follow the steps below to set required connection properties in the Connection Manager.
- Create a new connection manager: In the Connection Manager window, right-click and then click New Connection. The Add SSIS Connection Manager dialog is displayed.
- Select CData AmazonAthena Connection Manager in the menu.
- Configure the connection properties. A typical connection requires:
- AccessKey
- SecretKey
- Region
- Database
- S3StagingDirectory
Amazon Athena への接続
Amazon Athena リクエストの認証には、アカウントの管理のクレデンシャルか、IAM ユーザーのカスタムPermission を設定します。 AccessKey にAccess Key Id、SecretKey にはSecret Access Key を設定します。
Note: AWS アカウントアドミニストレータとしてアクセスできる場合でも、AWS サービスへの接続にはIAM ユーザークレデンシャルを使用することが推奨されます。
Access Key の取得
IAM ユーザーのクレデンシャル取得は以下のとおり:
- IAM コンソールにログイン。
- Navigation ペインで[ユーザー]を選択。
- ユーザーのアクセスキーを作成または管理するには、ユーザーを選択してから[セキュリティ認証情報]タブを選択。
AWS ルートアカウントのクレデンシャル取得は以下のとおり:
- ルートアカウントの資格情報を使用してAWS 管理コンソールにサインイン。
- アカウント名または番号を選択し、表示されたメニューで[My Security Credentials]を選択。
- [Continue to Security Credentials]をクリックし、[Access Keys]セクションを展開して、ルートアカウントのアクセスキーを管理または作成。
EC2 インスタンスからの認証
EC2 インスタンスから本製品を使用していて、そのインスタンスにIAM ロールが割り当てられている場合は、認証にIAM ロールを使用できます。 これを行うには、UseEC2Roles をtrue に設定しAccessKey とSecretKey を空のままにします。 本製品は自動的にIAM ロールの認証情報を取得し、それらを使って認証します。
AWS ロールとして認証
多くの場合、認証にはAWS ルートユーザーのダイレクトなセキュリティ認証情報ではなく、IAM ロールを使用することをお勧めします。 代わりにRoleARN を指定してAWS ロールを使用できます。これにより、本製品は指定されたロールの資格情報を取得しようと試みます。 (すでにEC2 インスタンスなどで接続されているのではなく)AWS に接続している場合は、役割を担うIAM ユーザーのAccessKeyと SecretKey を追加で指定する必要があります。AWS ルートユーザーのAccessKey およびSecretKey を指定する場合、 ロールは使用できません。
MFA での認証
多要素認証を必要とするユーザーおよびロールには、MFASerialNumber およびMFAToken 接続プロパティを指定してください。 これにより、本製品は一時的な認証資格情報を取得するために、リクエストでMFA 認証情報を送信します。一時的な認証情報の有効期間 (デフォルトは3600秒)は、TemporaryTokenDuration プロパティを介して制御できます。
Amazon Athena への接続
AccessKey とSecretKey プロパティに加え、Database、S3StagingDirectory、Region を設定します。Region をAmazon Athena データがホストされているリージョンに設定します。S3StagingDirectory をクエリの結果を格納したいS3内のフォルダに設定します。
接続にDatabase が設定されていない場合は、本製品はAmazon Athena に設定されているデフォルトデータベースに接続します。
Configure the Amazon Athena Destination
In the destination component Connection Manager, define mappings from the SQL Server source table into the Amazon Athena destination table.
- Double-click the Amazon Athena destination to open the destination component editor.
- In the Connection Managers tab, select the connection manager previously created.


Run the Project
You can now run the project. After the SSIS Task has finished executing, data from your SQL table will be exported to the chosen table.
