def get_resource_yaml(event: KubernetesResourceEvent):
    """
    Export Kubernetes resources from the cluster as the yaml file.
    Expects the kind of resource, its name and namespace.
    """
    resource = event.get_resource()
    if not resource:
        raise ActionException(ErrorCodes.RESOURCE_NOT_FOUND, "Resource not found for get resource yaml.")

    resource_kind = resource.kind
    namespace: str = resource.metadata.namespace
    name: str = resource.metadata.name

    if resource_kind.lower() in RESOURCE_YAML_BLOCK_LIST:
        raise ActionException(ErrorCodes.RESOURCE_NOT_PERMITTED, f"{resource_kind.lower()} type is blocked for get resource yaml.")

    try:
        resource_yaml = hikaru.get_yaml(resource)
        event.add_enrichment(
            [
                MarkdownBlock(f"Your YAML file for {resource_kind} {namespace}/{name}"),
                FileBlock(f"{name}.yaml", resource_yaml.encode()),
            ],
        )
    except KeyError:
        raise ActionException(ErrorCodes.RESOURCE_NOT_SUPPORTED, f"{resource_kind} is not supported for get resource yaml.")
    except Exception as e:
        raise ActionException(ErrorCodes.ACTION_UNEXPECTED_ERROR, f"{e}")

    Export Kubernetes resources from the cluster as the yaml file.
    Expects the kind of resource, its name and namespace.
    
playbooks/robusta_playbooks/k8s_resource_enrichments.py