public function setInstanceConfig($instanceConfig)
    {
        $this->instanceConfig = json_encode($instanceConfig);

        if (json_last_error() !== JSON_ERROR_NONE) {
            throw new \Exception(json_last_error_msg());
        }
    }