Skip to content

Instantly share code, notes, and snippets.

@OksanaH
Last active Dec 4, 2020
Embed
What would you like to do?
private static async Task<TableDescription> CreateTable(string name)
{
var request = new CreateTableRequest
{
AttributeDefinitions = new List<AttributeDefinition>()
{
new AttributeDefinition{
AttributeName = "City",
AttributeType = "S"
},
new AttributeDefinition{
AttributeName = "Date",
AttributeType = "S"
}
},
TableName = name,
ProvisionedThroughput = new ProvisionedThroughput
{
ReadCapacityUnits = 15,
WriteCapacityUnits = 15
},
KeySchema = new List<KeySchemaElement>
{
new KeySchemaElement
{
AttributeName="City",
KeyType="HASH"
},
new KeySchemaElement
{
AttributeName="Date",
KeyType="Range"
}
}
};
var response = await client.CreateTableAsync(request);
return response.TableDescription;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment