我们可以使用以下代码来解决此问题:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "organizations:DescribeOrganization", "organizations:DescribeAccount", "organizations:DescribeCreateAccountStatus", "organizations:ListAccountsForParent" ], "Resource": "*" } ] }
aws iam create-policy --policy-name AccessAnalyzerServiceLinkedRolePolicy --policy-document file://AccessAnalyzerServiceLinkedRolePolicy.json aws iam create-role --role-name AccessAnalyzerServiceLinkedRole --assume-role-policy-document file://AssumeAccessAnalyzerServiceLinkedRolePolicy.json aws iam attach-role-policy --role-name AccessAnalyzerServiceLinkedRole --policy-arn arn:aws:iam::123456789012:policy/AccessAnalyzerServiceLinkedRolePolicy
这将确保Access Analyzer服务链接角色在组织管理账户中可用。