You can also do this with an instance of com.amazonaws.services.dynamodbv2.document.Table :
table.deleteItem("hashKeyAttributeName", hashKey, "rangeKeyAttribureName", rangeKey);
To create an instance of a table, you can use the following:
BasicAWSCredentials credentials = new BasicAWSCredentials(amazonAWSAccessKey, amazonAWSSecretKey); // set access and secret keys AmazonDynamoDB amazonDynamoDB = AmazonDynamoDBClientBuilder.standard() .withCredentials(new AWSStaticCredentialsProvider(credentials)) .withRegion("us-west-1") // set aws region .build(); Table table = new DynamoDB(amazonDynamoDB).getTable(tableName);
source share