【发布时间】:2020-07-26 09:43:18
【问题描述】:
我有以下脚本:
Parameters:
bucket:
Type: CommaDelimitedList
Description: "Name of the Amazon S3 bucket that contains your file"
Default: "my-bucket"
fileuri:
Type: String
Description: "Path to the file in S3"
Default: "https://my-bucket.s3.eu-west-2.amazonaws.com/oauth-private.key"
authrole:
Type: String
Description: "Role with permissions to download the file from Amazon S3"
Default: "aws-elasticbeanstalk-ec2-role"
files:
/var/app/current/storage/oauth-private.key:
mode: "000600"
owner: webapp
group: webapp
source: { "Ref" : "fileuri" }
authentication: S3AccessCred
Resources:
AWSEBAutoScalingGroup:
Type: "AWS::AutoScaling::AutoScalingGroup"
Metadata:
AWS::CloudFormation::Authentication:
S3AccessCred:
type: "S3"
roleName: { "Ref" : "authrole" }
buckets: { "Ref" : "bucket" }
我遇到的问题是,在部署它时,/var/app/current/storage 目录中不存在该文件。
我认为这个脚本可能运行得太快了,current 目录还没有准备好,所以我尝试了ondeck 目录,这也不起作用。
如果我将路径更改为我的代码库目录以外的任何其他位置,则该文件将从 S3 复制。
有什么想法吗?谢谢。
【问题讨论】:
标签: amazon-web-services amazon-s3 amazon-elastic-beanstalk