Disabling the DMS API returns error

Problem

When trying to disable the Database Migration Service (DMS) API, the following error is thrown:

If datamigration.googleapis.com has resources in use, please deactivate them and try again

The same error is thrown after all the Migration Jobs and Connection Profiles are deleted in the DMS UI.

Environment

  • DMS API

Solution

  1. Use the gcloud tool or call the DMS API to list the connection profiles for the locations that were used previously for resource creation.
  2. Delete the corresponding connection profiles using the API or gcloud tool.

Cause

The resources that are not visible in the Cloud Console are the destination connection profiles. These are not shows as independent connection profiles in the UI because they are auto-generated by Cloud SQL as part of the migration job creation.