private function describeMainStack(CloudFormationException & $cloudFormationException = null)
    {
        $cloudFormation = $this->getService();

        try {
            $stack = $cloudFormation->describeStacks([
                'StackName' => $this->getName(),
            ]);

            return $stack['Stacks'];
        } catch (CloudFormationException $e) {
            $cloudFormationException = $e;
            $message = $e->getMessage();
        }

        if (1 === preg_match('/AccessDenied|403 Forbidden/i', $message)) {
            throw new \BuildException('You are not authorized to perform describeStacks on [' . $this->getName() . ']. Check the credentials and AWS policy');
        }

        if (1 ===  preg_match('/Could not resolve host/i', $message)) {
            throw new \BuildException("Could not resolve AWS host, thanks to check the AWS_REGION settings or connectivity");
        }

        return null;
    }