public function create(DynamoDbClient $client, string $tableName): void
    {
        try {
            $client->describeTable(['TableName' => $tableName]);
            return;
        } catch (DynamoDbException $e) {
            // table doesn't exist, create it below
        }

        try {
            $client->createTable([
                'TableName'              => $tableName,
                'AttributeDefinitions'   => [
                    ['AttributeName' => self::HASH_KEY_NAME, 'AttributeType' => 'S'],
                    ['AttributeName' => self::RANGE_KEY_NAME, 'AttributeType' => 'N'],
                    ['AttributeName' => self::GSI_EVENT_ID_HASH_KEY_NAME, 'AttributeType' => 'S'],
                ],
                'KeySchema'              => [
                    ['AttributeName' => self::HASH_KEY_NAME, 'KeyType' => 'HASH'],
                    ['AttributeName' => self::RANGE_KEY_NAME, 'KeyType' => 'RANGE'],
                ],
                'GlobalSecondaryIndexes' => [
                    [
                        'IndexName'             => self::GSI_EVENT_ID_NAME,
                        'KeySchema'             => [
                            ['AttributeName' => self::GSI_EVENT_ID_HASH_KEY_NAME, 'KeyType' => 'HASH'],
                        ],
                        'Projection'            => [
                            'ProjectionType' => 'KEYS_ONLY',
                        ],
                        'ProvisionedThroughput' => [
                            'ReadCapacityUnits'  => 2,
                            'WriteCapacityUnits' => 2,
                        ],
                    ],
                ],
                'StreamSpecification'    => [
                    'StreamEnabled'  => true,
                    'StreamViewType' => 'NEW_IMAGE',
                ],
                'ProvisionedThroughput'  => [
                    'ReadCapacityUnits'  => 2,
                    'WriteCapacityUnits' => 2,
                ],
            ]);

            $client->waitUntil('TableExists', ['TableName' => $tableName]);
        } catch (\Throwable $e) {
            throw new EventStoreOperationFailed(
                sprintf(
                    '%s::Unable to create table [%s] in region [%s].',
                    ClassUtils::getShortName($this),
                    $tableName,
                    $client->getRegion()
                ),
                Code::INTERNAL,
                $e
            );
        }
    }