def METHOD_NAME(self, output_sam):
    if "Resources" not in output_sam:
        return
    for _, resource in output_sam.get("Resources", {}).items():
        if "Metadata" not in resource:
            continue
        resource.get("Metadata", {}).pop("SamResourceId", None)
        resource.get("Metadata", {}).pop("SamNormalize", None)
        if not resource.get("Metadata", {}):
            resource.pop("Metadata")