# Redshift

Codatumを使用して、Redshiftのデータに接続、クエリ、管理ができます。

{% hint style="warning" %}
この機能は現在プライベートプレビューです。この機能のご利用を希望される場合は、Codatumサポートまでお問い合わせください。
{% endhint %}

## 設定方法

Redshift連携は、RA3ノードのクラスターとサーバーレスを対象とします。

### 1. AWSコンソールで必要な準備を行う

#### DBにおける必要な権限の付与

連携用のロールを作成し、権限を付与します。

* 使用したいスキーマに対する `USAGE` 権限をそのロールに付与する
* 使用したいテーブルに対する `SELECT` 権限をそのロールに付与する
* システムビュー `svv_table_info` に対する `SELECT` 権限をそのロールに付与する

#### IAMユーザーの作成とポリシーの付与

* 連携用のIAMユーザーを作成し、 `AmazonRedshiftFullAccess` ポリシーを付与する

#### Secrets ManagerでSecretの作成

* 接続したいData Warehouseを指定し、Secretを作成する
* 作成したSecretに `RedshiftDataFullAccess` というタグを追加する（Valueは空でOK）

### 2. CodatumにRedshiftコネクションを登録する

最後に、CodatumでRedshiftコネクションを作成します。

* `ワークスペース設定`の`コネクション`から`コネクションを追加`を選択
* `コネクション名`を入力
* `アクセスレベル`を選択
* `アカウントID` を入力
  * AWSのアカウントIDです。
* `リージョン` を入力
  * Redshiftリソースが属しているリージョンです。
* `接続タイプ` を選択
  * クラスターを選択した場合
    * `クラスター識別子` を入力
    * `デフォルトデータベース` を入力
      * 接続先のデータベースです。この設定は、クエリ可能なデータベース、スキーマ、テーブルを制限するものではありません。
  * サーバーレスを選択した場合
    * `サーバーレス 名前空間` を入力
    * `サーバーレス ワークグループ名` を入力
    * `デフォルトデータベース` を入力
      * 接続先のデータベースです。この設定は、クエリ可能なデータベース、スキーマ、テーブルを制限するものではありません。
* `AWS アクセスキー` を入力
  * ステップ1で準備したIAMユーザーのアクセスキーを使用します。
* `AWS シークレットアクセスキー` を入力
  * ステップ1で準備したIAMユーザーのシークレットアクセスキーを使用します。
* `シークレットARN` を入力
  * ステップ1で準備したSecretのシークレットARNを使用します。

入力が完了したら、接続テストを行った後、コネクションを保存してください。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.codatum.jp/connect-and-manage-data/supported-warehouses/redshift.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
