AWS DMS - 数据库迁移服务系统错误 MESSAGE:The IAM 角色 arn:aws:iam::<account_id>:role/dms-vpc-role 未正确配置

AWS DMS - Database Migration Service SYSTEM ERROR MESSAGE:The IAM Role arn:aws:iam::<account_id>:role/dms-vpc-role is not configured properly

我正在尝试创建 DMS(数据库迁移服务)实例,但出现以下错误:

SYSTEM ERROR MESSAGE:The IAM Role arn:aws:iam::<account_id>:role/dms-vpc-role is not configured properly

我应该创建什么角色以及我应该将其分配给什么角色?

您需要允许 DMS 承担一个角色:

  1. 创建文件dmsAssumeRolePolicyDocument.json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Service": "dms.amazonaws.com"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}
  1. 创建角色:

aws iam create-role --role-name dms-vpc-role --assume-role-policy-document file:///tmp/dmsAssumeRolePolicyDocument.json

  1. 附加角色:

aws iam attach-role-policy --role-name dms-vpc-role --policy-arn arn:aws:iam::aws:policy/service-role/AmazonDMSVPCManagementRole

现在您可以继续在控制台中或使用 awscli 创建 DMS 实例

好像他们更改了 IAM 角色,如果现在有人尝试这样做,最简单的解决方案是在 AWS 控制台中创建一个复制实例,dms-vpc-role 将自动创建。

然后您可以删除 'temporal' 实例和 运行 cloudformation/aws cli 来创建您想要的实例。

如果您想手动创建角色,附加的策略必须是 AmazonDMSVPCManagementRole

并包含以下权限:

{
"Version": "2012-10-17",
"Statement": [
    {
        "Effect": "Allow",
        "Action": [
            "ec2:CreateNetworkInterface",
            "ec2:DescribeAvailabilityZones",
            "ec2:DescribeInternetGateways",
            "ec2:DescribeSecurityGroups",
            "ec2:DescribeSubnets",
            "ec2:DescribeVpcs",
            "ec2:DeleteNetworkInterface",
            "ec2:ModifyNetworkInterfaceAttribute"
        ],
        "Resource": "*"
    }
]
}