async function createGlobalTable()

in source/custom-resources/global-table-creator.js [65:81]


async function createGlobalTable(properties) {
  const { UserPoolTable, SecondaryRegion } = properties;

  try {
    return await dynamodb.updateTable({
      TableName: UserPoolTable,
      ReplicaUpdates: [
        {
          Create: { RegionName: SecondaryRegion }
        }
      ]
    }).promise();
  } catch (error) {
    console.error(`Error occurred while creating global table in ${SecondaryRegion}.`);
    throw error;
  }
}