尝试发布到我在 API 网关中创建的 API:
{
"Message": "User: anonymous is not authorized to perform: execute-api:Invoke on resource: arn:aws:execute-api:us-west-2:***********:jrr7u1ekrr/v0/POST/user"
}
如何更新 CloudFormation 中的策略以使 POST 端点公开可用?我正在声明 APIAWS::ApiGateway::RestApi
资源类型。
API 策略属性为:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": "*",
"Action": "execute-api:Invoke",
"Resource": "execute-api:/*/POST/user"
}
]
}
让我困惑的是:“如果 API 之前已在 API Gateway 控制台中部署,则需要重新部署它才能使资源策略生效。”
https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-resource-policies-create-attach.html https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-resource-policies-create-attach.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)