Local dynamodb no credentials error
![local dynamodb no credentials error local dynamodb no credentials error](https://i.stack.imgur.com/S6wtC.png)
![local dynamodb no credentials error local dynamodb no credentials error](https://image.slidesharecdn.com/gettingstartedwithnosqlonaws-160914181155/85/getting-started-with-amazon-dynamodb-28-320.jpg)
You can see that as the stack traces show that AmazonHttpClient.java is trying to get credentials using getCredentialsFromContext.Īn access key ID & secret access key must be set for all requests but for the local DDB, these can be set to any dummy & fake values. This means it will still be checking if credentials are present before sending the request.Īs most people will be using the remote cloud version of DDB, which requires credentials, this allows the client to not call the remote server when it knows the request will fail - faster error handling, no network cost, etc. The DynamoDB SDK is oblivious to if you are using a local or remote cloud version of DynamoDB.
![local dynamodb no credentials error local dynamodb no credentials error](https://www.rahulpnath.com/static/34d7f95c33b83789bd1d36b165e0ca37/a4c27/aws_dynamodb_create_table_portal.jpg)
It looks like you never have set up any credentials for AWS on your machine for the SDK to use. However, I get the below exception: : Unable to load AWS credentials from any provider in the chainĪt .getCredentials(AWSCredentialsProviderChain.java:131)Īt $RequestExecutor.getCredentialsFromContext(AmazonHttpClient.java:1115)Īt $nBeforeRequestHandlers(AmazonHttpClient.java:764)Īt $RequestExecutor.doExecute(AmazonHttpClient.java:728)Īt $RequestExecutor.executeWithTimer(AmazonHttpClient.java:721)Īt $RequestExecutor.execute(AmazonHttpClient.java:704)Īt $RequestExecutor.access$500(AmazonHttpClient.java:672)Īt $RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:654)Īt .execute(AmazonHttpClient.java:518)Īt 2.AmazonDynamoDBClient.doInvoke(AmazonDynamoDBClient.java:1831)Īt 2.AmazonDynamoDBClient.invoke(AmazonDynamoDBClient.java:1807)Īt 2.AmazonDynamoDBClient.createTable(AmazonDynamoDBClient.java:636)Īt 2.(DynamoDB.java:96)Īt 2.(DynamoDB.java:108)Īt (DBUtil.java:24)Īt (DocumentTest.java:37) New AttributeDefinition("row_id", ScalarAttributeType.S)), New KeySchemaElement("row_id", KeyType.RANGE)),Īrrays.asList(new AttributeDefinition("row_name", ScalarAttributeType.S), New AwsClientBuilder.EndpointConfiguration(" aws_region)).build() ĭynamoDB = new DynamoDB(amazonDynamoDBClient) Īnd this is how I'm trying to create the table: Table table = dynamoDB.createTable(table_name,Īrrays.asList(new KeySchemaElement("row_name", KeyType.HASH), Private static AmazonDynamoDB amazonDynamoDBClient ĪmazonDynamoDBClient = AmazonDynamoDBClientBuilder.standard().withEndpointConfiguration(
![local dynamodb no credentials error local dynamodb no credentials error](https://www.codurance.com/hubfs/Imported_Blog_Media/2019-02-13-add-role.png)
Private static String aws_region = "us-west-2" This is how I create the DynamoDB client: private static final String table_name = "table-A" am writing a functional test case and connecting to a local DyanmoDB instance within it. I'm running my tests in IntelliJ, the maven setup is as follows: I should be able to set it to "local" but it's failing unless I set a real region. Can anyone see what i'm doing wrong? AWSCredentials credentials = new BasicAWSCredentials(myAccessKey, "localTest") ĪmazonDynamoDBClient client = new AmazonDynamoDBClient(credentials) ĬtRegion(Region.getRegion(Regions.EU_WEST_1)) ītw, the same is true for the setRegion. The problem is, when I try and create a client that accesses the local version of Dynamo, I get an error: AmazonServiceException: The request signature we calculated does not match the signature you providedĮverything that I've read says that the secret is not checked when using a local dynamoDb, so my suspicion is that, for whatever reason, i'm accessing my real dynamodb. (and I've added them to the end of this question). I'm using Maven to start a local copy of DynamoDb for testing.įor those that are interested, I've copied the instructions here