ada*_*810 2 amazon-ec2 amazon-web-services amazon-elastic-beanstalk
我有一个要设置的弹性beantalk节点应用程序。我正在尝试从S3加载环境文件,/var/app/ondeck/src/以便在启动Node应用程序时可以使用该文件。我已经尝试了很多事情,但是production.env文件从不显示。如果我将位置更改为类似/home/ec2-user文件出现的位置,那么我知道文件部分正确。我想念什么?
files:
"/var/app/ondeck/src/production.env":
mode: "000777"
user: nodejs
group: nodejs
source: https://s3.amazonaws.com/bucket-name/file.env
Resources:
AWSEBAutoScalingGroup:
Metadata:
AWS::CloudFormation::Authentication:
S3Access:
type: S3
roleName: aws-elasticbeanstalk-ec2-role
buckets: bucket-name
Run Code Online (Sandbox Code Playgroud)
========
不得已的想法是运行container_command,该命令只会将文件从中复制/home/ec2-user到中/var/app/current/src/,/var/app/ondeck/src/但似乎也不起作用。如果可能的话,我更喜欢让最优秀的例子工作。
container_commands:
command: "/bin/cp /home/ec2-user/production.env /var/app/ondeck/production.env"
Run Code Online (Sandbox Code Playgroud)
您的后一种选择似乎对我有所修改。请注意以下几点:
mv代替cpwebapp而不是nodejs,但这可能是因为我使用Beanstalk for PHP而不是Node就像这样:
files:
"/home/ec2-user/production.env":
mode: "000644"
owner: nodejs
group: nodejs
source: https://s3.amazonaws.com/bucket-name/file.env
container_commands:
01_mv_to_app_dir:
command: "mv /home/ec2-user/production.env ./production.env"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
495 次 |
| 最近记录: |