【发布时间】:2021-05-13 15:20:02
【问题描述】:
我是 AWS Cloudformation 的新手。我的 Elastic Beanstalk Worker 使用 Ruby on Rails。 EB是一个基于cloudformation模板的Stack。
不知道为什么,最近在部署(eb deploy)的时候,Event报错如下:
AWSEBLoadBalancer 不在模板的Resources: 中。但我在源代码的.ebextensions 中找到了。
Resources:
AWSEBLoadBalancer:
Properties:
AccessLoggingPolicy:
EmitInterval: 5
Enabled: true
S3BucketName:
Ref: LogsBucket
Type: "AWS::ElasticLoadBalancing::LoadBalancer"
DependsOn: "LogsBucketPolicy"
LogsBucket:
DeletionPolicy: Retain
Type: "AWS::S3::Bucket"
LogsBucketPolicy:
Properties:
Bucket:
Ref: LogsBucket
PolicyDocument:
Statement:
-
Action:
- "s3:PutObject"
Effect: Allow
Principal:
AWS:
? "Fn::FindInMap"
:
- Region2ELBAccountId
-
Ref: "AWS::Region"
- AccountId
Resource:
? "Fn::Join"
:
- ""
-
- "arn:aws:s3:::"
-
Ref: LogsBucket
- /AWSLogs/
-
Ref: "AWS::AccountId"
你能给我一些提示来解决这个问题吗?
【问题讨论】:
-
可以展示一下模板吗?
-
@Marcin 感谢您检查我的问题。我已经更新了我的问题。
标签: ruby-on-rails amazon-elastic-beanstalk amazon-cloudformation