本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
設定先決條件許可
建立包含下列必要資源群組動作的自訂政策:
-
resource-groups:CreateGroup
-
resource-groups:DeleteGroup
-
resource-groups:GetGroupQuery
-
resource-groups:ListGroupResources
-
resource-groups:Tag
-
tag:GetResources
如需如何新增內嵌政策的指示,請參閱新增IAM身分許可 (主控台)。當您選擇政策格式時,請選擇JSON格式並新增下列政策:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "resource-groups:ListGroupResources" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "resource-groups:GetGroupQuery" ], "Resource": "arn:aws:resource-groups:*:*:group/*" }, { "Effect": "Allow", "Action": [ "resource-groups:CreateGroup", "resource-groups:Tag" ], "Resource": "arn:aws:resource-groups:*:*:group/*", "Condition": { "ForAnyValue:StringEquals": { "aws:TagKeys": "sagemaker:collection" } } }, { "Effect": "Allow", "Action": "resource-groups:DeleteGroup", "Resource": "arn:aws:resource-groups:*:*:group/*", "Condition": { "StringEquals": { "aws:ResourceTag/sagemaker:collection": "true" } } }, { "Effect": "Allow", "Action": "tag:GetResources", "Resource": "*" } ] }