【发布时间】:2021-12-30 04:09:45
【问题描述】:
在部署包含 Elastic Beanstalk Stack 的 Cloud Formation 模板时,我收到以下错误:
访问被拒绝:S3Bucket=elasticbeanstalk-platform-assets-eu-central-1,S3Key=stalks/eb_corretto11_amazon_linux_2_1.0.2777.0_20211016030628/packs/Corretto11Template.pack(服务:AWSElasticBeanstalk;状态代码:403;错误代码:InsufficientPrivilegesException;请求 ID:5a2d57e4-cd43-443b-9407-b0fc0234ea40;代理:空)
由于它是一个 S3 错误 (InsufficientPrivilegesException),我似乎缺少权限。问题是它无法访问的 S3 存储桶不在我的帐户 S3 存储桶列表中,并且似乎是一种区域存储桶,所以我无法添加策略...有人遇到过这个错误吗? 背景信息:我在使用 AWS 组织的根账户内的账户中工作......
这是我的 iam 角色模板,包括托管策略 arn:
BackendServiceRole:
Type: AWS::IAM::Role
Properties:
RoleName: !Sub '${GroupName}BackendServiceRole'
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Principal:
Service:
- elasticbeanstalk.amazonaws.com
Action:
- 'sts:AssumeRole'
ManagedPolicyArns: [arn:aws:iam::aws:policy/AWSElasticBeanstalkManagedUpdatesCustomerRolePolicy]
在我的环境中的后端模板中,我添加了以下选项设置:
MyEnvironment:
Type: AWS::ElasticBeanstalk::Environment
Properties:
ApplicationName: !Ref MyBackendApplication
CNAMEPrefix: !Sub '${ApplicationName}'
EnvironmentName: !Sub '${ApplicationName}-Environment'
SolutionStackName: 64bit Amazon Linux 2 v3.2.7 running Corretto 11
Tier:
Name: WebServer
Type: Standard
OptionSettings:
- Namespace: aws:elasticbeanstalk:environment
OptionName: ServiceRole
Value: !GetAtt BackendServiceRole.Arn
# bunch of other options here
已经谢谢了!
【问题讨论】:
-
你确定你甚至可以使用来自不同账户的 S3 存储桶吗?
-
@Marcin 你是什么意思?如果这回答了你的问题,我从来没有故意提到这个桶。但这就是异常中的存储桶,它不在我的 S3 存储桶列表中
-
您检查过this AWS forum entry 是否对您有帮助吗?
标签: amazon-web-services amazon-s3 amazon-elastic-beanstalk amazon-cloudformation