尝试发布到我在 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 端点公开可用?我使用 AWS::ApiGateway::RestApi
资源类型声明 API。
API 策略属性是:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": "*",
"Action": "execute-api:Invoke",
"Resource": "execute-api:/*/POST/user"
}
]
}
最佳答案
让我困惑的事情:“如果 API 之前已在 API Gateway 控制台中部署,则需要重新部署它才能使资源策略生效。”
关于amazon-web-services - AWS API网关: User anonymous is not authorized to execute API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53016110/