Skip to content

Running DMS tasks

0

Hi, I have numerous tasks under a specific replication instance. My query is - do we have a command where we can run all the tasks associated with a replication instance, I am looking forward to avoiding specifying every task ARN in my pipeline.. Please advise

asked 2 years ago517 views

2 Answers
0

Hi,

You can achieve what you are looking for via aws dms describe-replication-tasks (if you work with CLI but equivalent possible with same API if you use another SDK): the response list contains ReplicationInstanceArn on which you can filter to dynamically obtain a list of all tasks running on a given instance.

{
    "ReplicationTasks": [
        {
            "ReplicationTaskIdentifier": "moveit2",
            "SourceEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA",
            "TargetEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:EOM4SFKCZEYHZBFGAGZT3QEC5U",
            "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE",
            "MigrationType": "full-load",
            "TableMappings": ...output omitted... ,
            "ReplicationTaskSettings": ...output omitted... ,
            "Status": "stopped",
            "StopReason": "Stop Reason FULL_LOAD_ONLY_FINISHED",
            "ReplicationTaskCreationDate": 1590524772.505,
            "ReplicationTaskStartDate": 1590619805.212,
            "ReplicationTaskArn": "arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII",
            "ReplicationTaskStats": {
                "FullLoadProgressPercent": 100,
                "ElapsedTimeMillis": 0,
                "TablesLoaded": 0,
                "TablesLoading": 0,
                "TablesQueued": 0,
                "TablesErrored": 0,
                "FreshStartDate": 1590619811.528,
                "StartDate": 1590619811.528,
                "StopDate": 1590619842.068
            }
        }
    ]
}

Doc is here: https://docs.aws.amazon.com/cli/latest/reference/dms/describe-replication-tasks.html

Best,

Didier

EXPERT

answered 2 years ago

0

Hi,

Thanks for taking your time to respond. I see that you have hard-coded your task ARN

"ReplicationTaskArn": "arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII",

I have close to 50+ tasks running under a replication instance, and looking for a command or a way to run all 50+ associated to that replication instance.

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.