本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
了解使用规则所需的 IAM 权限
必须向用户授予使用 Amazon Managed Service for Prometheus 中规则的权限。创建具有以下权限的 AWS Identity and Access Management (IAM) 策略,并将该策略分配给您的用户、群组或角色。
授权用户使用规则的策略
以下策略授权使用账户中所有资源的规则。
- JSON
-
-
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"aps:CreateRuleGroupsNamespace",
"aps:ListRuleGroupsNamespaces",
"aps:DescribeRuleGroupsNamespace",
"aps:PutRuleGroupsNamespace",
"aps:DeleteRuleGroupsNamespace"
],
"Resource": "*"
}
]
}
仅授予一个命名空间访问权限的策略
您也可以创建仅允许访问特定策略的策略。以下示例策略仅授予对指定的 RuleGroupNamespace
的访问权限。要使用此政策,请将<account>
、<region>
<workspace-id>
、和,替换为<namespace-name>
与您的账户对应的值。
- JSON
-
-
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"aps:ListRules",
"aps:ListTagsForResource",
"aps:GetLabels",
"aps:CreateRuleGroupsNamespace",
"aps:ListRuleGroupsNamespaces",
"aps:DescribeRuleGroupsNamespace",
"aps:PutRuleGroupsNamespace",
"aps:DeleteRuleGroupsNamespace"
],
"Resource": [
"arn:aws:aps:*:111122223333
:workspace/*",
"arn:aws:aps:us-east-1
:111122223333
:rulegroupnamespace/workspace-id
/namespace-name
"
]
}
]
}