def validate_ec2_browser_config(self):
        """Validate that the ec2 config is conform
        """

        if self.config.get('launch', True):
            required_keys = [
                'browserName',
                'platform',
                'ssh_key_path',
                'username',
                'amiid',
                'region',
                'instance_type',
                'security_group_ids',
                'selenium_command'
            ]
        else:
            required_keys = [
                'browserName',
                'platform'
            ]

        for key in required_keys:
            if key not in self.config.keys():
                msg = "Add the config: %s" % key
                self.runner.critical_log(msg)
                raise BromeBrowserConfigException(msg)

        optional_keys = {
            'terminate': True,
            'launch': True,
            'record_session': False,
            'vnc_port': 5900,
            'vnc_password': '',
            'vnc_password_file': '~/.vnc/passwd',
            'nb_browser_by_instance': 1,
            'max_number_of_instance': 1,
            'hub_ip': 'localhost'
        }
        for key, default in iter(optional_keys.items()):
            if key not in self.config.keys():
                self.runner.warning_log(
                    "Missing config: %s; using default: %s" %
                    (key, default)
                )
                self.config[key] = default
Validate that the ec2 config is conform