首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从boto3脚本创建AWS任务

从boto3脚本创建AWS任务
EN

Stack Overflow用户
提问于 2021-06-25 08:48:56
回答 1查看 1.4K关注 0票数 1

使用下面的python boto3脚本创建AWS任务并启动复制任务,但得到以下错误:

错误:

代码语言:javascript
复制
botocore.errorfactory.InvalidResourceStateFault: An error occurred (InvalidResourceStateFault) when calling the StartReplicationTask operation: Replication Task cannot be started, invalid state

Python脚本:

代码语言:javascript
复制
#!/usr/bin/python
import boto3
client_dms = boto3.client('dms')

#Create a replication DMS task
response = client_dms.create_replication_task(
    ReplicationTaskIdentifier='test-new1',
    ResourceIdentifier='test-new',
    ReplicationInstanceArn='arn:aws:dms:us-east-1:xxxxxxxxxx:rep:test1',
    SourceEndpointArn='arn:aws:dms:us-east-1:xxxxxxxxxx:endpoint:source',
    TargetEndpointArn='arn:aws:dms:us-east-1:xxxxxxxxxx:endpoint:target',
    MigrationType='full-load',
    TableMappings='{\n \"TableMappings\": [\n {\n \"Type\": \"Include\",\n \"SourceSchema\": \"test\",\n \"SourceTable\": \"table_name\"\n}\n ]\n}\n\n'
)

#Start the task from DMS
response = client_dms.start_replication_task(
    ReplicationTaskArn='arn:aws:dms:us-east-1:xxxxxxxxxx:task:test-new',
    StartReplicationTaskType='start-replication'
)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-06-25 08:55:55

要使任务准备就绪,可能必须使用:

才能对其执行其他操作。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68128129

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档