LoginSignup
11
10

More than 5 years have passed since last update.

S3のcsvをRDSに取り込む(DataPipelineで)

Last updated at Posted at 2016-02-16

AWSのData pipelineで簡単にS3のcsvをRDSに取り込めたのでめも。

設定

AWSのDataPipelineダッシュボードから、create new pipeline押して以下の設定

スクリーンショット 2016-02-16 4.13.20 PM.png

  • name: 適当に名前
  • description: 適当
  • source: load S3 data into RDS MySQL を選ぶ
  • RDS MySQL pass: mysql pass
  • input s3 file path: 取り込みたいcsvファイル
  • insert sql query: インサートクエリ
    • INSERT INTO log_test (col1, col2, col3, col4) VALUES (?, ?, ?, ?);
    • valuesの後は"?"にしないと動かなかった。placeholderかな。
  • RDS MySQL connection string: 接続先mysqlホスト情報
    • 例: jdbc:mysql://hoge.fuga.ap-northeast-1.rds.amazonaws.com:3306/table_name
  • scheduleは好きなように
  • logging: enabledを強くおすすめ。ログ吐きたいs3ディレクトリ指定

10分くらい気長に待つとtableにcsvデータ入ってます。

11
10
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
11
10