I am hosting a .NET backend app on Elastic Beanstalk. I made a config file like:
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
This seems to work, however, when I try to access the file in .NET by just using file
(I have also tried ./file
) as the path name, I get File not found
error. It says my current directory is var/app/current
.
I am ultimately unsure how I can even see the files in the ec2 for the EB instance to even see if it copied over, or failed without throwing an exception. And if it did copy over, where it is being put... Or am I just accessing the file wrong?
CodePudding user response:
The EB is going to overwrite your /var/app/current
at the end of your deployment. So whatever you write that in files
, gets deleted. You can try with /var/app/staging
. If this also does not work, you can consider keeping your files outside of /var/app
.