0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

terraformでredash環境を構築する時のRDSの初期テーブル作成エラー

Posted at

AWS上にterraformでredash環境を構築する場合にRDSの接続でエラーが出たのでメモ

構成

  • redashはECSクラスター上でコンテナにして動かす
  • redashのバックエンドはElasticCacheとRDSを利用
  • RDSのデータをredashで可視化する

今回はバックエンドで使用するRDSデータベースに関して

スクリーンショット 2017-08-25 18.11.35.png

問題となったエラー文

以前お手製で作ったRDSだとうまくいったが、
それと同じ設定のterraformで作成したRDSだと以下のエラーがでた。

Task redash.tasks.refresh_queries ... relation "queries" does not exist ...

queriesテーブルがないよって言われてる...
確かにRDSの中身を見てみるとterraformで作成したRDSのpostgresスキーマには
テーブルが一つも存在していなかった。

以前作ったRDSには色々テーブルができているがredashはいつ作ったのだろうか...

解決

初期設定時に自動で作ってくれそうな気もするが、
ひとまずデータベース作成用のコンテナを起動することでテーブルが作成された。
毎回create_dbをするのは少し違う気がするがひとまずデータが消えるわけでもないのでそれで対応

task_definition.json
...
{
    "essential": false,
    "name": "create_db_worker",
    "environment": [
      ...
    ],
    "image": "redash/redash:2.0.0.b2963",
    "command": [
      "create_db"
    ],
    "logConfiguration": {
      "logDriver": "awslogs",
      "options": {
        "awslogs-group": "ecs-log-group",
        "awslogs-region": "ap-northeast-1",
        "awslogs-stream-prefix": "redash"
      }
    },
    "cpu": 10,
    "memoryReservation": 128
  },
...
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?