amazon-web-services - AWS API 网关。从 github 更新现有 API。添加新路线
问题描述
我将通过 AWS CodePipeline 的 aws cli 命令 ( https://docs.aws.amazon.com/cli/latest/reference/apigateway/put-rest-api.html ) 更新现有的 Api 网关并遇到 CodeBuild 的问题
An error occurred (AccessDeniedException) when calling the GetRestApis operation: User: arn:aws:sts:<skipped_text> is not authorized to perform: apigateway:GET on resource: arn:aws:apigateway:us-west-2::/restapis
是否可以使用 CodePipeline 和 aws cli 通过代码更新 Api 网关?或者您使用什么作为更新 apigateway 的工具?
解决方案
确保向IAM 用户添加以下策略,以允许管理员访问(创建、读取、更新、删除)API 网关,
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"apigateway:*"
],
"Resource": "arn:aws:apigateway:*::/*"
}
]
}
这也存在于亚马逊管理的政策下AmazonAPIGatewayAdministrator
,
推荐阅读
- javascript - 您能否检测到何时从浏览器 PDF 查看器打印或下载 PDF?
- python - __init__ 中的 Python 3 NameError,未定义“会话”
- r - 如何使用 R 绘制极坐标?
- c# - C# WPF MVVM XAML:使用 ContentPresenter 样式显示 ViewModel
- html - 为什么我的控制台中没有显示 send_email 功能?
- python - 我收到错误回溯(最近一次调用最后一次):for i in num_guesses: TypeError: 'int' object is not iterable
- c - C:父进程和多个子进程之间的读写
- string - Idris 中的字符串替换功能
- python - 用于复制和重命名的python脚本
- c++-winrt - 如何从 MainPage 的 cppwinrt 模板项目中的 App 类调用函数