저는 Elastic beanstalk에 자동으로 배포하는 python 스크립트를 완료했습니다.boto 탄저병 콩 줄기 CreateApplicationVersion 403 금지됨
테스트 환경에서는 잘 작동합니다.
하지만 방금 사용자 키를 변경하면 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>"
]
}
]
}
답장을 보내 주셔서 감사합니다. CreateApplicationVersion 작업 이전에 S3 버킷에 zip 파일을 업로드합니다. 그것은 잘 부풀어 올랐다. 그러나 CreateApplicationVersion 작업을 시도하면 403이라고 표시됩니다. 다른 작업은 describe_applications()를 좋아하고 describe_environments (application_name = AWS_ELASTIC_BEANSTALK_APP_NAME)는 올바르게 작동합니다. – dorajistyle