授予 IAM 用户访问特定 api 网关 api 的 AWS 策略不起作用

问题描述 投票:0回答:1

我坚信这与 ARN 格式有关。

我创建了一个仅包含 put 操作的 REST API,该 API 会将文件上传到 S3 存储桶。

我创建了一个名为integration_test的IAM用户。现在我希望该用户只有一项权限,即访问上述 api,并且只允许 PUT 操作。如果我向该用户授予 AWS 托管 ApiGatewayInvokeFullAccess 权限,它就可以工作。

这是我到目前为止所得到的。

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "execute-api:Invoke",
                "apigateway:PUT"
            ],
            "Resource": "arn:aws-us-gov:apigateway:us-gov-west-1::/api/account-id:api:id/stages/dev/PUT/*"
        }
    ]
}

还想表明我在 AWS GOV 云上。

amazon-web-services aws-api-gateway amazon-iam aws-api-gateway-v2
1个回答
0
投票

据我所知,操作

apigateway:PUT
没有影响,因为资源不属于apigateway操作。

我想说你的资源是错误的,请参阅https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-control-access-using-iam-policies-to-invoke-api .html。检查语法并更正它,如

arn:aws-us-gov:execute-api:us-gov-west-1::<api-id>/dev/PUT/*

© www.soinside.com 2019 - 2024. All rights reserved.