How can I resolve the error “Task assessment has not been run or dms-access-for-tasks IAM Role not configured correctly” when creating an AWS DMS task assessment report?

Last updated: 2019-10-02

I'm creating an AWS Database Migration Service (AWS DMS) task assessment report, and I received an error. Why did I receive this error, and how do I resolve the error?

Short Description

The AWS DMS task assessment feature needs an AWS Identity and Access Management (IAM) role, dms-access-for-tasks, to create assessment reports from the AWS DMS console. If you use the AWS DMS console to create your task, then the required IAM role is created automatically.

If you create your tasks using the AWS Schema Conversion Tool, the AWS DMS API, or the AWS Command Line Interface (AWS CLI), then you might not have the required IAM role in your AWS DMS account.

If you use the AWS DMS console to create the assessment but you don't have the required role, then the Assessment result section spins and won't load. If you use the AWS CLI and you don't have the required role, then you receive the following error:

aws dms start-replication-task-assessment --replication-task-arn arn:aws:dms:us-east-1:111122223333:task:7IO2XNXCO6WOFUOENK3L3B73BI
An error occurred (ResourceNotFoundFault) when calling the StartReplicationTaskAssessment operation: Task assessment has not been run or dms-access-for-tasks IAM Role not configured correctly

Resolution

  1. Open the IAM console, and choose Roles from the navigation pane.
  2. Choose Create role.
  3. Choose AWS service from Select type of trusted entity.
  4. Choose DMS as the service that will use this role.
  5. Choose Next: Permissions.
  6. Enter AmazonDMSRedshiftS3Role in the search field, and choose the policy to grant Amazon Redshift access to your task.
  7. Choose Next: Review.
  8. Enter dms-access-for-tasks as the Role name.
  9. Choose Create role.
  10. Open the AWS DMS console, and create an AWS DMS task assessment report.

After you create the assessment report, the task state is Assessing. After the assessment is complete, you can review the output in the Assessment result section.

Alternatively, you can create an assessment report by running the following AWS CLI commands:

aws dms start-replication-task-assessment --replication-task-arn arn:aws:dms:us-east-1:111122223333:task:7IO2XNXCO6WOFUOENK3L3B73BI    

{
    "ReplicationTask": {
        "ReplicationTaskIdentifier": "mysql-redshift-role-test",
        "SourceEndpointArn": "arn:aws:dms:us-east-1:111122223333:endpoint:WC5WECKT33UFIIGONLR3CIDVTQ",
        "TargetEndpointArn": "arn:aws:dms:us-east-1:111122223333:endpoint:YME4L3EKXLK66FTUDR3U3QF6TM",
        "ReplicationInstanceArn": "arn:aws:dms:us-east-1:111122223333:rep:YE423BFOMC5TMCUEBJCBWTWVIM",
        "MigrationType": "full-load-and-cdc",
        "TableMappings": "{…}",
        "Status": "testing",
        "StopReason": "Stop Reason NORMAL",
        "ReplicationTaskCreationDate": 1565811111.001,
        "ReplicationTaskArn": "arn:aws:dms:us-east-1:111122223333:task:7IO2XNXCO6WOFUOENK3L3B73BI"
    }
}

Note: Replace the example task Amazon Resource Name (ARN) with your own task ARN.

View the assessment report by running following AWS CLI commands:

aws dms describe-replication-task-assessment-results --replication-task-arn arn:aws:dms:us-east-1:111122223333:task:7IO2XNXCO6WOFUOENK3L3B73BI

{
   "ReplicationTaskAssessmentResults": [
        {
            "ReplicationTaskIdentifier": "mysql-redshift-role-test",
            "ReplicationTaskArn": "arn:aws:dms:us-east-1:111122223333:task:7IO2XNXCO6WOFUOENK3L3B73BI",
            "ReplicationTaskLastAssessmentDate": 1565818659.0,
            "AssessmentStatus": "No issues found",
            "AssessmentResultsFile": "mysql-redshift-role-test/2019-01-01-01-01”,
            "AssessmentResults":"…"
        }
    ]
}

Note: Replace the example task ARN with your own task ARN.


Did this article help you?

Anything we could improve?


Need more help?