{"action":"created","issue":{"url":"https://api.github.com/repos/CargoSense/ex_aws/issues/42","labels_url":"https://api.github.com/repos/CargoSense/ex_aws/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/CargoSense/ex_aws/issues/42/comments","events_url":"https://api.github.com/repos/CargoSense/ex_aws/issues/42/events","html_url":"https://github.com/CargoSense/ex_aws/issues/42","id":91287978,"number":42,"title":"All DynamoDB requests time out","user":{"login":"jordi-chacon","id":153220,"avatar_url":"https://avatars.githubusercontent.com/u/153220?v=3","gravatar_id":"","url":"https://api.github.com/users/jordi-chacon","html_url":"https://github.com/jordi-chacon","followers_url":"https://api.github.com/users/jordi-chacon/followers","following_url":"https://api.github.com/users/jordi-chacon/following{/other_user}","gists_url":"https://api.github.com/users/jordi-chacon/gists{/gist_id}","starred_url":"https://api.github.com/users/jordi-chacon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordi-chacon/subscriptions","organizations_url":"https://api.github.com/users/jordi-chacon/orgs","repos_url":"https://api.github.com/users/jordi-chacon/repos","events_url":"https://api.github.com/users/jordi-chacon/events{/privacy}","received_events_url":"https://api.github.com/users/jordi-chacon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/CargoSense/ex_aws/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-06-26T16:04:42Z","updated_at":"2015-06-29T17:36:09Z","closed_at":null,"body":"Hi!\r\n\r\nFirst of all, thank you so much for putting so much time and dedication into this library. I truly appreciate it! I think it's awesome that you made it possible to get the credentials via the EC2 role!\r\n\r\nI am facing some problems when running my Elixir application from within an EC2 instance inside an ECS container. All requests time out.\r\n\r\nThis is my ex_aws config:\r\n```\r\n[dynamodb: [\r\n  scheme: {:system, \"DYNAMODB_SCHEME\"},\r\n  host: {:system, \"DYNAMODB_HOST\"},\r\n  port: {:system, \"DYNAMODB_PORT\"},\r\n  region: \"eu-west-1\"\r\n],\r\nincluded_applications: [],\r\naccess_key_id: [{:system, \"AWS_ACCESS_KEY_ID\"}, :instance_role],\r\nsecret_access_key: [{:system, \"AWS_SECRET_ACCESS_KEY\"}, :instance_role]]\r\n```\r\n\r\nThe last two OS env variables are undefined, so the :instance_role is used.\r\n\r\nI have put an IO.inspect on ExAws.Request.request/5 to better understand what might be the problem:\r\n\r\nBody of the request:\r\n```\r\n%{\"AttributeDefinitions\" => [%{\"AttributeName\" => :uid,\r\n     \"AttributeType\" => \"S\"}],\r\n  \"KeySchema\" => [%{\"AttributeName\" => \"uid\", \"KeyType\" => \"HASH\"}],\r\n  \"ProvisionedThroughput\" => %{\"ReadCapacityUnits\" => 1,\r\n    \"WriteCapacityUnits\" => 1}, \"TableName\" => \"facebook_service_users\"}\r\n```\r\n\r\nHeaders:\r\n```\r\n[{\"Authorization\",\r\n  \"AWS4-HMAC-SHA256 Credential=/20150626/eu-west-1/dynamodb/aws4_request,SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,Signature=668....f\"},\r\n {\"host\", \"dynamodb.eu-west-1.amazonaws.com\"},\r\n {\"x-amz-date\", \"20150626T155125Z\"},\r\n {\"x-amz-target\", \"DynamoDB_20120810.CreateTable\"},\r\n {\"content-type\", \"application/x-amz-json-1.0\"}, {\"x-amz-content-sha256\", \"\"}]\r\n```\r\n\r\nURL:\r\n```\r\nhttps://dynamodb.eu-west-1.amazonaws.com:80/\r\n```\r\n\r\nThis is the error I get in the logs:\r\n```\r\nExAws: HTTP ERROR: :connect_timeout\r\n```\r\n\r\nJust to rule out that the problem is not in the IAM side, I have tried to create a dynamodb table from the EC2 instances via awscli and that worked just fine. Therefore, the problem is at the application level.\r\n\r\nI am running my application with MIX_ENV=test.\r\n\r\nI would appreciate it if you would share with me any hints on what could be the problem.\r\n\r\nThank you a lot!"},"comment":{"url":"https://api.github.com/repos/CargoSense/ex_aws/issues/comments/116770452","html_url":"https://github.com/CargoSense/ex_aws/issues/42#issuecomment-116770452","issue_url":"https://api.github.com/repos/CargoSense/ex_aws/issues/42","id":116770452,"user":{"login":"jordi-chacon","id":153220,"avatar_url":"https://avatars.githubusercontent.com/u/153220?v=3","gravatar_id":"","url":"https://api.github.com/users/jordi-chacon","html_url":"https://github.com/jordi-chacon","followers_url":"https://api.github.com/users/jordi-chacon/followers","following_url":"https://api.github.com/users/jordi-chacon/following{/other_user}","gists_url":"https://api.github.com/users/jordi-chacon/gists{/gist_id}","starred_url":"https://api.github.com/users/jordi-chacon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordi-chacon/subscriptions","organizations_url":"https://api.github.com/users/jordi-chacon/orgs","repos_url":"https://api.github.com/users/jordi-chacon/repos","events_url":"https://api.github.com/users/jordi-chacon/events{/privacy}","received_events_url":"https://api.github.com/users/jordi-chacon/received_events","type":"User","site_admin":false},"created_at":"2015-06-29T17:36:09Z","updated_at":"2015-06-29T17:36:09Z","body":"The IAM simulator says the operation is allowed. All DynamoDB operations are allowed by my policy. Furthermore, I have sent such requests from both inside the EC2 instance and from inside an ECS container via awscli."}}