简体   繁体   中英

Boto3 - Wait until AWS Database Migration Task is deleted

Requirement: Delete DMS Task, DMS Endpoints and Replication Instance.

Use : Boto3 python script in Lambda

My Approach:
1. Delete the Database Migration Task first as Endpoint and Replication Instance cant be deleted before deleting this.
2. Delete Endpoints
3. Delete Replication Instance

Issue: When i am running these 3 delete commands, i get the following error

"errorMessage": "An error occurred (InvalidResourceStateFault) when calling the DeleteEndpoint operation:Endpoint arn:aws:dms:us-east-1:XXXXXXXXXXXXXX:endpoint:XXXXXXXXXXXXXXXXXXXXXX is part of one or more ReplicationTasks.

Here i know that Data migration task will take some time to delete. So till then Endpoint will be occupied by Task. So we cant delete it.

There is a aws cli command to check whether task is deleted or not - replication-task-deleted .

I can run this in shell and wait(sleep) until i get the final status and then execute delete Endpoint script.

There is no equivalent command in Boto3 DMS docs

Is there any other Boto3 command i can use to check the status and make my python script sleep till that time?

Please let me know if i can approach the the issue in different way.

你需要使用服务员在你的情况下Waiter.ReplicationTaskDeleted

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM