LoginSignup
0
0

More than 5 years have passed since last update.

AWS CLI を使ってタスクを複製する方法

Posted at

はじめに

AWS DMS で既存のタスクと同一の設定を持つ別のタスクを作成したい場合には、AWS CLI を使うと容易に複製することが出来ます。

手順

既存タスクの設定を input.json に書き出します。

$ DMS_TASK_NAME=TEST
$ aws dms describe-replication-tasks --filters "Name=replication-task-id,Values=${DMS_TASK_NAME}" --query "ReplicationTasks[0].{SourceEndpointArn: SourceEndpointArn, ReplicationTaskIdentifier: ReplicationTaskIdentifier, ReplicationInstanceArn: ReplicationInstanceArn, TableMappings: TableMappings, MigrationType: MigrationType, TargetEndpointArn: TargetEndpointArn, ReplicationTaskSettings: ReplicationTaskSettings}" > input.json

書き出した input.json の ReplicationTaskIdentifier の値を既存タスクと重複しないよう変更します。以下の例では "TEST" を別の文字列に変更します。

input.json
{
    "SourceEndpointArn": "arn:aws:dms:ap-northeast-1:xxxxxxxxxxxx:endpoint:XXXXXXXXXXXXXXXXXXXXXXXXXX",
    "ReplicationTaskIdentifier": "TEST",
    "ReplicationInstanceArn": "arn:aws:dms:ap-northeast-1:xxxxxxxxxxxx:rep:XXXXXXXXXXXXXXXXXXXXXXXXXX",
    "TableMappings": ...
...

そして input.json を引数として、新規タスクを作成します。

$ aws dms create-replication-task --cli-input-json file://input.json

参考情報

describe-replication-tasks
create-replication-task

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