【问题标题】:AWS API Gateway IAM Policy Role in Docs Fails in SimulationDocs 中的 AWS API Gateway IAM 策略角色在模拟中失败
【发布时间】:2015-11-12 23:34:36
【问题描述】:

AWS 的 AWS IAM 政策文档 (shown here) 表明以下政策为角色提供了完全访问 API 网关的权限

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "apigateway:*"
      ],
      "Resource": [
        "*"
      ]
    }
  ]
}

当以 API Gateway 为目标模拟该策略时,该策略会拒绝访问。这似乎与提供的文档直接矛盾。

【问题讨论】:

    标签: amazon-web-services amazon-iam amazon-cognito aws-api-gateway


    【解决方案1】:

    亚马逊的权限模型将 API Gateway 权限分为两种服务:

    • Amazon API Gateway - 客户端的权限,目前唯一的操作是 execute-api:invoke
    • 管理 - API 网关 - 用于配置 API 网关的管理员权限,其中包含符合 apigateway:* 规范的 CRUD 操作。

    您的策略适用于 Manage API Gateway 服务,如果您选择该策略,模拟应该可以工作。

    在常规 IAM 策略向导中可以看到相同的分隔,其中“管理 - API 网关”排序到服务列表的底部,您看不到它。

    【讨论】:

    • 大多数教程指定"Resource": "arn:aws:execute-api:*:*:*",一旦您选择了API Gateway - Invoke,它就必须反映在ARN中。使用向下 chevron 访问它。
    猜你喜欢
    • 2017-07-26
    • 2018-06-08
    • 2018-11-02
    • 2018-09-29
    • 1970-01-01
    • 2018-09-02
    • 2018-04-07
    • 1970-01-01
    • 2022-08-17
    相关资源
    最近更新 更多