我在 Elastic Beanstalk 上托管了一個 .NET 后端應用程式。我做了一個組態檔,如:
Resources:
AWSEBAutoScalingGroup:
Metadata:
AWS::CloudFormation::Authentication:
S3Auth:
type: "s3"
buckets: ["my-bucket"]
roleName:
"Fn::GetOptionSetting":
Namespace: "aws:autoscaling:launchconfiguration"
OptionName: "IamInstanceProfile"
DefaultValue: "aws-elasticbeanstalk-ec2-role"
files:
# Private key
"/var/app/current/file":
mode: "000400"
owner: root
group: root
authentication: "S3Auth"
source: https://my-url/file
這似乎有效,但是,當我嘗試僅使用file(我也嘗試過./file)作為路徑名來訪問 .NET 中的檔案時,File not found出現錯誤。它說我當前的目錄是var/app/current.
我最終不確定我如何才能看到 ec2 中 EB 實體的檔案,甚至可以查看它是否復制了,或者在不引發例外的情況下失敗。如果它確實復制了,它被放在哪里......或者我只是訪問了錯誤的檔案?
uj5u.com熱心網友回復:
EB 將在您的部署結束時覆寫您/var/app/current。所以無論你在 中寫什么files,都會被洗掉。您可以嘗試使用/var/app/staging. 如果這也不起作用,您可以考慮將檔案保存在/var/app.
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/313591.html
上一篇:如何根據條件訪問類屬性
下一篇:無法確定序列化資訊
