0

I am learning about microservices and Docker and I have made a small application in visual studio 2022 that basically can perform CRUD operations on the DynamoDB (with ASP.NET 6.0). When I run the project on localhost everything works, but as soon as I make a docker container and try to perform crud from the Docker container, I get an error that states:

unable to get iam security credentials from ec2 instance metadata service

I tried a bunch of things like changing my appsettings.json, but came to the conclusion that that is not the problem since it works when I run the solution locally.

When I google about this problem I get overflow with information about running DynamoDB locally. I get that that is good for developing purpose, but I still want to try to perform CRUD operations on my DynamoDB from the Docker container (and think it must be possible).

So my question is: is it possible to access my DynamoDB table from a Docker image?

Coder
  • 159
  • 1
  • 9

1 Answers1

0

I have found the answer. The problem was in my docker-compose file where I needed the following line: volumes: - ~/.aws/:/root/.aws:ro

I found it on this post: AWS DotNet SDK Error: Unable to get IAM security credentials from EC2 Instance Metadata Service

by user @smcg

Coder
  • 159
  • 1
  • 9
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 20 '22 at 12:39