繁体   English   中英

boto弹性beantalk创建应用程序版本403禁止

[英]boto elastic beanstalk CreateApplicationVersion 403 Forbidden

我已经完成了一个自动部署到Elastic beantalk的python脚本。

它在测试环境中正常工作。

但是,当我刚刚更改用户密钥时,Boto会使用正确的策略说“ 403 Forbidden”。

https://policysim.aws.amazon.com表示该用户允许CreateApplicationVersion。

但是boto不允许CreateApplicationVersion操作。

boto==2.28
python==2.7.5

有人遇到过这个问题吗?

Traceback (most recent call last):
  File "upload_to_aws.py", line 135, in <module> 
description=None, s3_bucket=AWS_ELASTIC_BEANSTALK_S3_BUCKET_NAME, s3_key=zip_file)
  File "/usr/lib/python2.7/site-packages/boto/beanstalk/layer1.py", line 156, in create_application_version
return self._get_response('CreateApplicationVersion', params)
  File "/usr/lib/python2.7/site-packages/boto/beanstalk/layer1.py", line 71, in _get_response
raise self.ResponseError(response.status, response.reason, body)
boto.exception.BotoServerError: BotoServerError: 403 Forbidden
{"Error":{"Code":"AccessDenied","Message":"User: arn:aws:iam::<account-id>:user/<username> is not authorized to perform: elasticbeanstalk:CreateApplicationVersion on resource: arn:aws:elasticbeanstalk:ap-northeast-1:<account-id>:applicationversion/<application-name>/<application-version>","Type":"Sender"},"RequestId":"<request-id>"}

IAM政策:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "Stmt1000000000000",
      "Effect": "Allow",
      "Action": [
        "s3:*"
      ],
      "Resource": [
        "arn:aws:s3:::mybucket/*",
        "arn:aws:s3:::mybucket",
      ]
    },
{
      "Sid": "Stmt1000000000001",
      "Effect": "Allow",
      "Action": [
        "elasticbeanstalk:*"
      ],
      "Resource": [
        "arn:aws:elasticbeanstalk:ap-northeast-1:<account-id>:environment/<application name>/<environment-name>"
      ]
    }
  ]
}

我真的不认为这是个boto问题。 它只是使用您提供的凭据进行API调用。 如果服务显示403则您正在使用的凭据未获得该操作的授权。

对于CreateApplicationVersion操作,您还必须传入版本数据所在的S3存储桶。 您使用的帐户是否有权访问该存储桶?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM