Răzvan Flavius Panda
Răzvan Flavius Panda

Reputation: 22106

AWS Lambda accessing file

I have a certificate file named development.p12 under folder Certificates. Its build action is set to Content. This allows reading the file using the path "Certificates\\development.p12" when running locally. When publishing to AWS Lambda this does not work though - the file can not be found using the same path.

At which path can I access the file with build action Content under AWS Lambda?

Upvotes: 4

Views: 6969

Answers (3)

Harish Srinivas
Harish Srinivas

Reputation: 1

If you are using C# then "AppDomain.CurrentDomain.BaseDirectory" will work. This pulls the files from /var/task folder in lambda.

Upvotes: 0

Thales Minussi
Thales Minussi

Reputation: 7215

Lambda functions run under Amazon Linux, therefore any Windows like path will not work. Not only that, the only directory you have write access to from within a Lambda function is /tmp

Do keep in mind that you have a limit of 512MB on this folder.

You can find more about AWS Lambda Execution Environment here and more about Lambda Limits here

Upvotes: 1

Răzvan Flavius Panda
Răzvan Flavius Panda

Reputation: 22106

The solution was to use the path "Certificates/development.p12" instead.

Upvotes: 1

Related Questions