-
-
Notifications
You must be signed in to change notification settings - Fork 431
AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are not being overridden by dotenv #13
Comments
Are you using the Try That will use whatever those variables are set to in your current env. If you want to supply a specific value, use |
Damn it, I completely forgot about the But I still don't understand why Thanks! |
It depends on how you're defining them. Are you doing it outside of the Lambda function, at the top-level during require time? Those variables are overridden each time Lambda executes – this is true in the live Lambda environment too – so unless you define them in your function body (which is not a good idea – you should manage your credentials using IAM in Lambda) – they will be overridden by the Lambda environment (or in this case, by the docker-lambda controlling code) |
Oh, I did not know that. I'm doing it like that
I'm sorry but
Could you please point me to the documentation page where I can see the description how to achieve that? |
Lambda will already set your Again, you really shouldn't be storing or loading these variables in Lambda itself (for testing it's fine, but you shouldn't be doing it via Lambda will assign those variables using temporary IAM credentials based on the IAM role that the Lambda is running. That's where you should manage all of your Lambda permissions – using the Role that you've assigned to the Lambda. See more info here: http://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html |
Oh ok, now I got it. Thank you. |
Closing as it seems the root cause of the issue has been found 👍 |
It's quite a wired issue, anyway, I can't find it out why it is like that.
I've developed a small lambda function, which I would like to be able to test locally first.
The main goal of the lambda function is to fetch and handle messages from
AWS SQS
.While I'm running that function with help this docker image
lambci/lambda
nothing happens, it waits for 10+ seconds and then stops it :(I'm using
dotenv
package to load some env-wise data to be able to connect to specific queue etc..and it looks like that
.env
file is loaded well (because I can see almost all variables from it), but two main variables can't be overwritten somehow, and I still see your image default valuesWhy so?
P.S. Looks like because of that my function are not able to make the connection to
AWS SQS
P.P.S. Meanwhile when I'm using this package everything is working well
The text was updated successfully, but these errors were encountered: