def METHOD_NAME(self) -> str:
    """
    Function creating cloud-init applicable file in yaml format from UserDataObjects.
    For each user data object (with script defined) will generate script file on VM Instance and add it's invocation to runcmd.
    In case of script execution failure it will create .failed file for each failed script.
    """
    packages = set()
    scripts = []
    runcmds = []
    for idx, user_data_object in enumerate(self.user_data_objects):
        script_path = f"{CLOUD_INIT_SCRIPTS_PATH}/{idx}_{user_data_object.name}.sh"
        packages.update(user_data_object.packages_to_install)
        if user_data_object.script_to_run:
            scripts.append({"content": user_data_object.script_to_run,
                            "path": script_path,
                            "permissions": "0644"
                            })
            runcmds.append(
                f"cd {CLOUD_INIT_SCRIPTS_PATH}; bash -eux {script_path}; test  $? = 0 || touch {script_path}.failed")
    # in case of problems with creating scripts, cloud-init won't run anything and will not report any error
    # to fix it create 'done' file as last step to enable further verification if executed at all
    runcmds.append(f"mkdir -p {CLOUD_INIT_SCRIPTS_PATH} && touch {CLOUD_INIT_SCRIPTS_PATH}/done")
    user_data_yaml = yaml.dump(data={
        "packages": list(packages),
        "write_files": scripts,
        "runcmd": runcmds
    } | self.yum_repos | self.apt_configuration)
    return "#cloud-config\n" + user_data_yaml