# DynamoDBStorage.InitializeTable(string, List&lt;KeySchemaElement&gt;, List&lt;AttributeDefinition&gt;, List&lt;GlobalSecondaryIndex&gt;, string?, CancellationToken)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.transactions.dynamodb/orleans.transactions.dynamodb.dynamodbstorage/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.transactions.dynamodb/orleans.transactions.dynamodb.dynamodbstorage/methods/)

[Source](https://github.com/dotnet/orleans/blob/b7a9e3e1c9c54b3cec3a467c5734bf7744541bcf/src/AWS/Shared/Storage/DynamoDBStorage.cs#L113-L137)

```csharp
public Task InitializeTable(string tableName, List<KeySchemaElement> keys, List<AttributeDefinition> attributes, List<GlobalSecondaryIndex>? secondaryIndexes = null, string? ttlAttributeName = null, CancellationToken cancellationToken = default(CancellationToken))
```

Create a DynamoDB table if it doesn't exist

### Parameters

- `tableName` (`string`): The name of the table
- `keys` (`List<KeySchemaElement>`): The keys definitions
- `attributes` (`List<AttributeDefinition>`): The attributes used on the key definition
- `secondaryIndexes` (`List<GlobalSecondaryIndex>`): (optional) The secondary index definitions
- `ttlAttributeName` (`string?`): (optional) The name of the item attribute that indicates the item TTL (if null, ttl won't be enabled)
- `cancellationToken` (`CancellationToken`): The cancellation token.
