code: async def setup(self):
          
          try:
              client = await self.db
              response = await client.list_tables()
              created = False
              # create table if not already created.
              if self.table_name not in response["TableNames"]:
                  logger.info("Creating DynamoDB table [{}]".format(self.table_name))
                  resp = await client.create_table(**self.table_schema)
                  if resp.get("ResponseMetadata", {}).get("HTTPStatusCode") == 200:
                      logger.info("DynamoDB table [{}] successfully created!".format(self.table_name))
                      created = True
              # create control table if not already created.
              if self.control_table_name and self.control_table_name not in response["TableNames"]:
                  logger.info("Creating DynamoDB control_table [{}]".format(self.control_table_name))
                  resp = await client.create_table(**self.control_table_schema)
                  if resp.get("ResponseMetadata", {}).get("HTTPStatusCode") == 200:
                      logger.info("DynamoDB control table [{}] successfully created!".format(self.control_table_name))
                      created = True
              return created
          except Exception as exc:
              logger.error("[DB] Error when setting up DynamoDB.")
              logger.error(exc)
          return False
docs: Setting up DynamoDB table, if it not exists.