AWS DMS 无法开始迁移

AWS DMS can not start migration

我为 AWS DMS 创建了一个堆栈,为两个测试 Postgres 数据库创建了另一个堆栈 AWS::RDS::DBInstancecfn-sphere 两个堆栈都已成功创建,我能够在源数据库中创建一个 table 并将数据加载到其中。

我试过 start the replication task with boto3:

client = boto3.client('dms')
response = client.start_replication_task(
    ReplicationTaskArn=replication_task_arn,
    StartReplicationTaskType='start-replication'
)

但是它没有用,我得到了错误:

botocore.errorfactory.InvalidResourceStateFault: An error occurred (InvalidResourceStateFault) when calling the StartReplicationTask operation: Test connection for replication instance ( url) should be successful for starting the replication task

我试图从网站触发它,但我收到一条错误消息:

AWSDatabaseMigrationService: Test connection for replication instance and endpoint should be successful for starting the replication task

不幸的是,复制实例和目标点之间的连接在网站上不起作用(我的帐户具有完全访问权限)。但它在我的命令行中与 boto3 dms 客户端一起工作,test_connection.

我的安全组规则是:

  SecurityGroupIngress:
    Type: 'AWS::EC2::SecurityGroupIngress'
    Properties:
      GroupId: !Ref dbSecurityGroup
      IpProtocol: tcp
      FromPort: '5432'
      ToPort: '5432'
      CidrIp: //my public ip

任何人都可以指导我在哪里查看以及如何修复它吗? (这是我的第一个 AWS 任务)

1) 确保复制实例和目标端点在同一个 vpc 中。否则,您必须执行 vpc 对等。两者也应该在同一地区。

2) 将复制实例的安全组添加到目标数据库安全组的入站规则中。

Type: AWS::EC2::SecurityGroup
Properties: 
  GroupName: "target-endpoint-sg"
  GroupDescription: "security group of target db server"
  VpcId: <provide your vpc id>
  SecurityGroupIngress:
    - IpProtocol: tcp
      FromPort: '5432'
      ToPort: '5432'
      SourceSecurityGroupId: <sec-grp of ReplicationInstance>

3) 如果您的目标数据库已经创建,则提供完整的服务器名称(例如:target-database-name.xxxxxxxxxxx.us-east-1.rds.amazonaws.com),当您创建 目标端点 时,用户名和密码值正确。在 aws 控制台中,转到 DMS -> Endpoints -> Select your endpoint checkbox -> Test connection 以验证连接。

如果成功,则在 boto3 客户端配置中使用相同用户的角色并使用 test_connection 方法进行测试。