我希望拥有一个能够创建 IAM 组织的 IAM 用户,仅此而已。
为此,我需要创建一个使用 SLR 的策略。
我将策略附加到我的 IAM 所属的组。
如果我使用通用 SLR 权限策略,我可以使用任何用户创建一个组织。
{
"Effect": "Allow",
"Action": "iam:CreateServiceLinkedRole",
"Resource": "arn:aws:iam::*:role/aws-service-role/*"
}
当我指定我想要拥有这些权限的确切用户资源时,我不能再这样做了。
这是 aws 文档中提供的模板
{
"Effect": "Allow",
"Action": "iam:CreateServiceLinkedRole",
"Resource": "arn:aws:iam::*:role/aws-service-role/SERVICE-NAME.amazonaws.com/SERVICE-LINKED-ROLE-NAME-PREFIX*",
"Condition": {"StringLike": {"iam:AWSServiceName": "SERVICE-NAME.amazonaws.com"}}
},
这是我的
{
"Effect": "Allow",
"Action": "iam:CreateServiceLinkedRole",
"Resource": "arn:aws:iam::000056397000:user/root_name:role/aws-service-role/organizations.amazonaws.com/*"
}
我得到的错误是:
An error occurred (AccessDeniedForDependencyException) when calling the CreateOrganization operation: The
request failed because your credentials do not have permission to create the service-linked role required
by AWS Organizations.
我错过了什么?