amazon-web-services - AWS API网关: User anonymous is not authorized to execute API

标签 amazon-web-services aws-cloudformation aws-api-gateway

尝试发布到我在 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 控制台中部署,则需要重新部署它才能使资源策略生效。”

https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-resource-policies-create-attach.html

关于amazon-web-services - AWS API网关: User anonymous is not authorized to execute API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53016110/

相关文章:

sql - 验证 SQL 查询和结果集

amazon-web-services - 我什么时候应该在 AWS 中使用 t2.medium 和 m3.medium 实例类型?

ios - 创建用于 AWS DynamoDB 的唯一主键

amazon-web-services - AWS云信息: is supporting multiple LogDrivers possible in ContainerDefinitions

amazon-web-services - AWS Cloudformation VPCPeering两个公共(public) VPC 之间的连接

mapping - Cloudformation 参数映射并使用 !join 加入 API Gateway uri

sql - 有没有办法在 AWS Redshift 中将 VARCHAR 转换为 DATE?

amazon-web-services - 有没有办法使用多个 aws 配置文件来部署(更新)无服务器堆栈?

amazon-web-services - 什么是AWS完美替代Azure SignalR服务?

aws-api-gateway - 在 ELB 中验证 API Gateway 客户端证书