Fix #36 Avoid failure on start due to CreateTable
Current implementation uses a ResourceInUse side-effect to detect that the table already exists. This requires that the user/role running the KCL have the CreateTable permission. Update the LeaseManager to check if the table exists to allow limited privilege users to run KCL code.
This commit is contained in:
parent
74c259ca11
commit
620d36559d
1 changed files with 3 additions and 0 deletions
|
|
@ -115,6 +115,9 @@ public class LeaseManager<T extends Lease> implements ILeaseManager<T> {
|
|||
request.setProvisionedThroughput(throughput);
|
||||
|
||||
try {
|
||||
if (leaseTableExists()) {
|
||||
return false;
|
||||
}
|
||||
dynamoDBClient.createTable(request);
|
||||
} catch (ResourceInUseException e) {
|
||||
tableDidNotExist = false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue