private async Task<string> SetupTable(IAmazonDynamoDB dynamoDBClient)
{
string tableName = "aws-sdk-dotnet-truncate-test-" + DateTime.Now.Ticks;
await dynamoDBClient.CreateTableAsync(
tableName,
new List<KeySchemaElement>
{
new KeySchemaElement { KeyType = KeyType.HASH, AttributeName = "Id" }
},
new List<AttributeDefinition>
{
new AttributeDefinition { AttributeName = "Id", AttributeType = ScalarAttributeType.S }
},
new ProvisionedThroughput { ReadCapacityUnits = 10, WriteCapacityUnits = 10 });
DescribeTableResponse response = null;
do
{
System.Threading.Thread.Sleep(300);
response = await dynamoDBClient.DescribeTableAsync(tableName);
} while (response.Table.TableStatus != TableStatus.ACTIVE);
return tableName;
}