-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamodb Error: Nodejs App with dynamodb does not work in docker but works without it #216
Comments
What is the output of:
Are there any values for those environment variables? Also try to put the credential keys directly in the code instead of getting them from the user's environment... Probably it is an environment issue. |
All the values work. I hard coded them to check. That did not work either with docker. I have been struggling with this for a couple of days. Let me know if i have to add any other details to this. Thanks for taking the time to respond |
In that case I guess you have 2 options: If you run |
There is a point of analysis which I did not highlight it enough.
|
Well then, the problem is in your docker configuration. Perhaps you should ask their community. As you know the docker container runs in sandboxed environment, which means it does not have access to the outside "world". You should put your AWS credentials inside the docker container and configure the user which runs the APP inside the container to have those environment credentials... Also ssl enabled is highly recommended since you may have sensitive information transferred from dynamoDB to your server such as users password and etc... |
@helloravi If you are using EC2, recommended way is to use IAM role to allow DynamoDB access and this will work for Docker apps. |
I made a simple nodejs app with only one table in dynamodb. I am using Vogels as the datawrapper. It works very well if I do not dockerize it.
I tried running the docker exactly the way I run the app in development mode too. That too did not work.
Here is the code I use to create tables:
Here is the error I get in docker:
One thing I clearly notice when I run it WITHOUT docker is that the dynamodb end point is a httpS end point. Here is the endpoint logged from https://github.com/aws/aws-sdk-js/blob/8904e9c730fb2fccf9d201f66266a6e2cbb75348/lib/http/node.js
(line number 13).
When I run it WITH docker is that the dynamodb end point is a http end point. Here is the endpoint logged from https://github.com/aws/aws-sdk-js/blob/8904e9c730fb2fccf9d201f66266a6e2cbb75348/lib/http/node.js
(line number 13).
Where am I going wrong with this?
The text was updated successfully, but these errors were encountered: