---
policy: /ce/ca/aws/eks/cluster-node-role-cni-policy
logic: /ce/ca/aws/eks/cluster-node-role-cni-policy/prod.logic.yaml
executionTime: 2025-06-28T12:02:53.060112597Z
rows:
  - id: test1
    match: true
    status:
      expected: DISAPPEARED
      actual: DISAPPEARED
    conditionIndex:
      expected: 99
      actual: 99
    conditionText:
      expected: isDisappeared(CA10A1__disappearanceTime__c)
      actual: isDisappeared(CA10A1__disappearanceTime__c)
    runtimeError: {}
  - id: test2
    match: true
    status:
      expected: INAPPLICABLE
      actual: INAPPLICABLE
    conditionIndex:
      expected: 199
      actual: 199
    conditionText:
      expected: CA10A1__AWS_IAM_OpenID_Connect_Providers__r.hasNo(COMPLIANT)
      actual: CA10A1__AWS_IAM_OpenID_Connect_Providers__r.hasNo(COMPLIANT)
    runtimeError: {}
  - id: test3
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 299
      actual: 299
    conditionText:
      expected: CA10A1__AWS_EKS_Cluster_Node_Groups__r.has(INCOMPLIANT)
      actual: CA10A1__AWS_EKS_Cluster_Node_Groups__r.has(INCOMPLIANT)
    runtimeError: {}
  - id: test4
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 399
      actual: 399
    conditionText:
      expected: CA10A1__AWS_EKS_Cluster_Node_Groups__r.has(COMPLIANT)
      actual: CA10A1__AWS_EKS_Cluster_Node_Groups__r.has(COMPLIANT)
    runtimeError: {}
  - id: test5
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 399
      actual: 399
    conditionText:
      expected: CA10A1__AWS_EKS_Cluster_Node_Groups__r.has(COMPLIANT)
      actual: CA10A1__AWS_EKS_Cluster_Node_Groups__r.has(COMPLIANT)
    runtimeError: {}
  - id: test6
    match: true
    status:
      expected: UNDETERMINED
      actual: UNDETERMINED
    conditionIndex:
      expected: 600
      actual: 600
    conditionText:
      expected: otherwise
      actual: otherwise
    runtimeError: {}
  - id: test7
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 399
      actual: 399
    conditionText:
      expected: CA10A1__AWS_EKS_Cluster_Node_Groups__r.has(COMPLIANT)
      actual: CA10A1__AWS_EKS_Cluster_Node_Groups__r.has(COMPLIANT)
    runtimeError: {}
  - id: test8
    match: true
    status:
      expected: DISAPPEARED
      actual: DISAPPEARED
    conditionIndex:
      expected: 599
      actual: 599
    conditionText:
      expected: CA10A1__AWS_EKS_Cluster_Node_Groups__r.has(DISAPPEARED)
      actual: CA10A1__AWS_EKS_Cluster_Node_Groups__r.has(DISAPPEARED)
    runtimeError: {}
usedFiles:
  - path: /ce/ca/aws/eks/cluster-node-role-cni-policy/policy.yaml
    md5Hash: 19D3B0D704B793A161B4817F8BFB1BA5
    content: "names:\n  full: \"AWS EKS Cluster has node IAM role with AmazonEKS_CNI_Policy\
      \ attached\"\n  contextual: \"Cluster has node IAM role with AmazonEKS_CNI_Policy\
      \ attached\"\ndescription: >\n  Ensures that the AmazonEKS_CNI_Policy is not\
      \ attached to the EKS \n  node's IAM role, promoting least privilege for the\
      \ Amazon VPC CNI plugin by \n  utilizing IAM Roles for Service Accounts (IRSA).\n\
      categories:\n  - \"SECURITY\"\n  - \"RELIABILITY\"\ntype: \"COMPLIANCE_POLICY\"\
      \nframeworkMappings:\n  - \"/frameworks/cloudaware/identity-and-access-governance/rbac-management\"\
      \n  - \"/frameworks/cloudaware/resource-reliability/system-configuration\""
  - path: /ce/ca/aws/eks/cluster-node-role-cni-policy/prod.logic.yaml
    md5Hash: F0DE1E9DA2311DECDE9B869560671226
    content: "inputType: \"CA10A1__CaAwsEksCluster__c\"\nimportExtracts:\n  - file:\
      \ \"/types/CA10__CaAwsIamRolePolicyAttachment__c/object.extracts.yaml\"\ntestData:\n\
      \  - file: \"test-data.json\"\nconditions:\n# VPC CNI plugin, as a prerequisite,\
      \ requires an existing AWS IAM OIDC provider for the cluster.\n# If the OIDC\
      \ provider does not exist, the cluster is considered INAPPLICABLE since this\
      \ topic is evaluated in /ce/ca/aws/eks/cluster-oidc-provider policy.\n  - status:\
      \ \"INAPPLICABLE\"\n    currentStateMessage: \"The VPC CNI plugin requires an\
      \ existing IAM OpenID Connect (OIDC) provider for the cluster.\"\n    check:\n\
      \      RELATED_LIST_HAS_NO:\n        status: \"COMPLIANT\"\n        relationshipName:\
      \ \"CA10A1__AWS_IAM_OpenID_Connect_Providers__r\"\n  - status: \"INCOMPLIANT\"\
      \n    currentStateMessage: \"The EKS Cluster's node IAM role has the AmazonEKS_CNI_Policy\
      \ attached.\"\n    remediationMessage: \"Consider configuring a separate IAM\
      \ role with Amazon EKS CNI policy attached and annotating the aws-node service\
      \ account with this role.\"\n    check:\n      RELATED_LIST_HAS:\n        status:\
      \ \"INCOMPLIANT\"\n        relationshipName: \"CA10A1__AWS_EKS_Cluster_Node_Groups__r\"\
      \n  - status: \"COMPLIANT\"\n    currentStateMessage: \"The EKS Cluster's node\
      \ IAM role does not have the AmazonEKS_CNI_Policy attached\"\n    check:\n \
      \     RELATED_LIST_HAS:\n        status: \"COMPLIANT\"\n        relationshipName:\
      \ \"CA10A1__AWS_EKS_Cluster_Node_Groups__r\"\n  - status: \"UNDETERMINED\"\n\
      \    currentStateMessage: \"Unable to determine the EKS Cluster's Node Groups.\"\
      \n    check:\n      RELATED_LIST_HAS:\n        status: \"UNDETERMINED\"\n  \
      \      relationshipName: \"CA10A1__AWS_EKS_Cluster_Node_Groups__r\"\n  - status:\
      \ \"DISAPPEARED\"\n    currentStateMessage: \"The EKS Cluster's Node Groups\
      \ are deleted in the CMDB.\"\n    check:\n      RELATED_LIST_HAS:\n        status:\
      \ \"DISAPPEARED\"\n        relationshipName: \"CA10A1__AWS_EKS_Cluster_Node_Groups__r\"\
      \notherwise:\n  status: \"UNDETERMINED\" \n  currentStateMessage: \"The EKS\
      \ Cluster doesn't have any Node Groups in the CMDB.\"\nrelatedLists:\n  - relationshipName:\
      \ \"CA10A1__AWS_IAM_OpenID_Connect_Providers__r\"\n    conditions: []\n    otherwise:\n\
      \      status: \"COMPLIANT\"\n      currentStateMessage: \"This is an IAM OpenID\
      \ Connect Provider.\"\n  - relationshipName: \"CA10A1__AWS_EKS_Cluster_Node_Groups__r\"\
      \n    conditions: \n      - status: \"INCOMPLIANT\" \n        currentStateMessage:\
      \ \"The Node Group's IAM role has the AmazonEKS_CNI_Policy attached.\"\n   \
      \     check:\n          RELATED_LIST_HAS:\n            status: \"INCOMPLIANT\"\
      \n            relationshipName: \"CA10A1__nodeRole__r.CA10__AWS_IAM_Role_Policy_Attachments__r\"\
      \n    otherwise:\n      status: \"COMPLIANT\"\n      currentStateMessage: \"\
      The Node Group's IAM role does not have the AmazonEKS_CNI_Policy attached.\"\
      \n    relatedLists:\n      - relationshipName: \"CA10A1__nodeRole__r.CA10__AWS_IAM_Role_Policy_Attachments__r\"\
      \n        conditions:\n        #TODO: add an INCOMPLIANT check for exact policy\
      \ permissions once supported\n          - status: \"INCOMPLIANT\"\n        \
      \    currentStateMessage: \"The AmazonEKS_CNI_Policy is attached to the node\
      \ IAM role.\"\n            check:\n              IS_EQUAL:\n               \
      \ left:\n                  EXTRACT: \"CA10__policyArn__c\"\n               \
      \ right:\n                  TEXT: \"arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy\"\
      \n        otherwise:\n          status: \"INAPPLICABLE\"\n          currentStateMessage:\
      \ \"Unrelated IAM Policy.\""
  - path: /types/CA10__CaAwsIamRolePolicyAttachment__c/object.extracts.yaml
    md5Hash: 3B1645AD49B1ED98D792A387F70B5AA5
    content: "# yaml-language-server: $schema=../../schema/Extracts.schema.json\n\
      ---\nextracts:\n- name: CA10__policyArn__c\n  value: \n    FIELD:\n      path:\
      \ CA10__policyArn__c\n- name: CA10__role__c\n  value: \n    FIELD:\n      path:\
      \ CA10__role__c\n- name: CA10__policy__c\n  value: \n    FIELD:\n      path:\
      \ CA10__policy__c"
  - path: /ce/ca/aws/eks/cluster-node-role-cni-policy/test-data.json
    md5Hash: AE51C3A05ED54A87B496CBB93AFA19CE
    content: |-
      [
          {
              "expectedResult": {
                  "status": "DISAPPEARED",
                  "conditionIndex": "99",
                  "conditionText": "isDisappeared(CA10A1__disappearanceTime__c)",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-05-27T04:46:05Z"
              },
              "Id": "test1",
              "CA10A1__disappearanceTime__c": "2025-05-26T09:12:47Z",
              "CA10A1__AWS_IAM_OpenID_Connect_Providers__r": [
                  {
                      "Id": "test1_1",
                      "CA10A1__disappearanceTime__c": "2025-05-26T08:55:05Z",
                      "CA10A1__eksCluster__c": "test1"
                  }
              ],
              "CA10A1__AWS_EKS_Cluster_Node_Groups__r": [
                  {
                      "Id": "test1_2",
                      "CA10A1__disappearanceTime__c": "2025-05-26T09:17:42Z",
                      "CA10A1__cluster__c": "test1",
                      "CA10A1__nodeRole__c": "",
                      "CA10A1__nodeRole__r": {
                          "Id": null,
                          "CA10__AWS_IAM_Role_Policy_Attachments__r": []
                      }
                  }
              ]
          },
          {
              "expectedResult": {
                  "status": "INAPPLICABLE",
                  "conditionIndex": "199",
                  "conditionText": "CA10A1__AWS_IAM_OpenID_Connect_Providers__r.hasNo(COMPLIANT)",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-05-27T04:46:05Z"
              },
              "Id": "test2",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__AWS_IAM_OpenID_Connect_Providers__r": [],
              "CA10A1__AWS_EKS_Cluster_Node_Groups__r": [
                  {
                      "Id": "test2_2",
                      "CA10A1__disappearanceTime__c": null,
                      "CA10A1__cluster__c": "test2",
                      "CA10A1__nodeRole__c": "nodeRole2",
                      "CA10A1__nodeRole__r": {
                          "Id": "nodeRole2",
                          "CA10__AWS_IAM_Role_Policy_Attachments__r": [
                              {
                                  "Id": "test2_3",
                                  "CA10__disappearanceTime__c": null,
                                  "CA10__policyArn__c": "arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy",
                                  "CA10__role__c": "nodeRole2"
                              }
                          ]
                      }
                  }
              ]
          },
          {
              "expectedResult": {
                  "status": "INCOMPLIANT",
                  "conditionIndex": "299",
                  "conditionText": "CA10A1__AWS_EKS_Cluster_Node_Groups__r.has(INCOMPLIANT)",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-05-27T04:46:05Z"
              },
              "Id": "test3",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__AWS_IAM_OpenID_Connect_Providers__r": [
                  {
                      "Id": "test3_1",
                      "CA10A1__disappearanceTime__c": null,
                      "CA10A1__eksCluster__c": "test3"
                  }
              ],
              "CA10A1__AWS_EKS_Cluster_Node_Groups__r": [
                  {
                      "Id": "test3_2",
                      "CA10A1__disappearanceTime__c": null,
                      "CA10A1__cluster__c": "test3",
                      "CA10A1__nodeRole__c": "nodeRole3",
                      "CA10A1__nodeRole__r": {
                          "Id": "nodeRole3",
                          "CA10__AWS_IAM_Role_Policy_Attachments__r": [
                              {
                                  "Id": "test3_3",
                                  "CA10__disappearanceTime__c": null,
                                  "CA10__policyArn__c": "arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy",
                                  "CA10__role__c": "nodeRole3"
                              }
                          ]
                      }
                  }
              ]
          },
          {
              "expectedResult": {
                  "status": "COMPLIANT",
                  "conditionIndex": "399",
                  "conditionText": "CA10A1__AWS_EKS_Cluster_Node_Groups__r.has(COMPLIANT)",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-05-27T04:46:05Z"
              },
              "Id": "test4",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__AWS_IAM_OpenID_Connect_Providers__r": [
                  {
                      "Id": "test4_1",
                      "CA10A1__disappearanceTime__c": null,
                      "CA10A1__eksCluster__c": "test4"
                  }
              ],
              "CA10A1__AWS_EKS_Cluster_Node_Groups__r": [
                  {
                      "Id": "test4_2",
                      "CA10A1__disappearanceTime__c": null,
                      "CA10A1__cluster__c": "test4",
                      "CA10A1__nodeRole__c": "",
                      "CA10A1__nodeRole__r": {
                          "Id": null,
                          "CA10__AWS_IAM_Role_Policy_Attachments__r": []
                      }
                  }
              ]
          },
          {
              "expectedResult": {
                  "status": "COMPLIANT",
                  "conditionIndex": "399",
                  "conditionText": "CA10A1__AWS_EKS_Cluster_Node_Groups__r.has(COMPLIANT)",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-05-27T04:46:05Z"
              },
              "Id": "test5",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__AWS_IAM_OpenID_Connect_Providers__r": [
                  {
                      "Id": "test5_1",
                      "CA10A1__disappearanceTime__c": null,
                      "CA10A1__eksCluster__c": "test5"
                  }
              ],
              "CA10A1__AWS_EKS_Cluster_Node_Groups__r": [
                  {
                      "Id": "test5_2",
                      "CA10A1__disappearanceTime__c": null,
                      "CA10A1__cluster__c": "test5",
                      "CA10A1__nodeRole__c": "nodeRole5",
                      "CA10A1__nodeRole__r": {
                          "Id": "nodeRole5",
                          "CA10__AWS_IAM_Role_Policy_Attachments__r": [
                              {
                                  "Id": "test5_3",
                                  "CA10__disappearanceTime__c": null,
                                  "CA10__policyArn__c": "arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy",
                                  "CA10__role__c": "nodeRole5"
                              }
                          ]
                      }
                  }
              ]
          },
          {
              "expectedResult": {
                  "status": "UNDETERMINED",
                  "conditionIndex": "600",
                  "conditionText": "otherwise",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-05-27T04:46:05Z"
              },
              "Id": "test6",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__AWS_IAM_OpenID_Connect_Providers__r": [
                  {
                      "Id": "test6_1",
                      "CA10A1__disappearanceTime__c": null,
                      "CA10A1__eksCluster__c": "test6"
                  }
              ],
              "CA10A1__AWS_EKS_Cluster_Node_Groups__r": []
          },
          {
              "expectedResult": {
                  "status": "COMPLIANT",
                  "conditionIndex": "399",
                  "conditionText": "CA10A1__AWS_EKS_Cluster_Node_Groups__r.has(COMPLIANT)",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-05-27T04:46:05Z"
              },
              "Id": "test7",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__AWS_IAM_OpenID_Connect_Providers__r": [
                  {
                      "Id": "test7_1",
                      "CA10A1__disappearanceTime__c": null,
                      "CA10A1__eksCluster__c": "test7"
                  }
              ],
              "CA10A1__AWS_EKS_Cluster_Node_Groups__r": [
                  {
                      "Id": "test7_2",
                      "CA10A1__disappearanceTime__c": null,
                      "CA10A1__cluster__c": "test7",
                      "CA10A1__nodeRole__c": "nodeRole7",
                      "CA10A1__nodeRole__r": {
                          "Id": "nodeRole7",
                          "CA10__AWS_IAM_Role_Policy_Attachments__r": []
                      }
                  }
              ]
          },
          {
              "expectedResult": {
                  "status": "DISAPPEARED",
                  "conditionIndex": "599",
                  "conditionText": "CA10A1__AWS_EKS_Cluster_Node_Groups__r.has(DISAPPEARED)",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-05-27T04:46:05Z"
              },
              "Id": "test8",
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__AWS_IAM_OpenID_Connect_Providers__r": [
                  {
                      "Id": "test8_1",
                      "CA10A1__disappearanceTime__c": null,
                      "CA10A1__eksCluster__c": "test8"
                  }
              ],
              "CA10A1__AWS_EKS_Cluster_Node_Groups__r": [
                  {
                      "Id": "test8_2",
                      "CA10A1__disappearanceTime__c": "2025-05-27T04:46:05Z",
                      "CA10A1__cluster__c": "test8",
                      "CA10A1__nodeRole__c": "nodeRole8",
                      "CA10A1__nodeRole__r": {
                          "Id": "nodeRole8",
                          "CA10__AWS_IAM_Role_Policy_Attachments__r": [
                              {
                                  "Id": "test8_3",
                                  "CA10__disappearanceTime__c": null,
                                  "CA10__policyArn__c": "arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy",
                                  "CA10__role__c": "nodeRole8"
                              }
                          ]
                      }
                  }
              ]
          }
      ]
script: |-
  CREATE TEMP FUNCTION mock_ExpectedResult()
  RETURNS ARRAY<STRUCT<
          Id STRING,
          expectedResult STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, runtimeError STRING>
      >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "Id" : "test1",
    "expectedResult" : {
      "status" : "DISAPPEARED",
      "conditionIndex" : "99",
      "conditionText" : "isDisappeared(CA10A1__disappearanceTime__c)",
      "runtimeError" : null
    }
  }, {
    "Id" : "test2",
    "expectedResult" : {
      "status" : "INAPPLICABLE",
      "conditionIndex" : "199",
      "conditionText" : "CA10A1__AWS_IAM_OpenID_Connect_Providers__r.hasNo(COMPLIANT)",
      "runtimeError" : null
    }
  }, {
    "Id" : "test3",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "299",
      "conditionText" : "CA10A1__AWS_EKS_Cluster_Node_Groups__r.has(INCOMPLIANT)",
      "runtimeError" : null
    }
  }, {
    "Id" : "test4",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : "399",
      "conditionText" : "CA10A1__AWS_EKS_Cluster_Node_Groups__r.has(COMPLIANT)",
      "runtimeError" : null
    }
  }, {
    "Id" : "test5",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : "399",
      "conditionText" : "CA10A1__AWS_EKS_Cluster_Node_Groups__r.has(COMPLIANT)",
      "runtimeError" : null
    }
  }, {
    "Id" : "test6",
    "expectedResult" : {
      "status" : "UNDETERMINED",
      "conditionIndex" : "600",
      "conditionText" : "otherwise",
      "runtimeError" : null
    }
  }, {
    "Id" : "test7",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : "399",
      "conditionText" : "CA10A1__AWS_EKS_Cluster_Node_Groups__r.has(COMPLIANT)",
      "runtimeError" : null
    }
  }, {
    "Id" : "test8",
    "expectedResult" : {
      "status" : "DISAPPEARED",
      "conditionIndex" : "599",
      "conditionText" : "CA10A1__AWS_EKS_Cluster_Node_Groups__r.has(DISAPPEARED)",
      "runtimeError" : null
    }
  } ];
  """;

  CREATE TEMP FUNCTION mock_CA10A1__CaAwsEksCluster__c()
  RETURNS ARRAY<STRUCT<
      Id STRING,
      CA10A1__disappearanceTime__c TIMESTAMP,
      context STRUCT<
          snapshotTime TIMESTAMP
      >
  >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "test1",
    "CA10A1__disappearanceTime__c" : new Date("2025-05-26T09:12:47Z")
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "test2"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "test3"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "test4"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "test5"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "test6"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "test7"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "test8"
  } ];
  """;

  CREATE TEMP FUNCTION mock_CA10A1__CaAwsIamOpenIdConnectProvider__c()
  RETURNS ARRAY<STRUCT<
      Id STRING,
      CA10A1__disappearanceTime__c TIMESTAMP,
      CA10A1__eksCluster__c STRING,
      context STRUCT<
          snapshotTime TIMESTAMP
      >
  >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "test1_1",
    "CA10A1__disappearanceTime__c" : new Date("2025-05-26T08:55:05Z"),
    "CA10A1__eksCluster__c" : "test1"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "test3_1",
    "CA10A1__eksCluster__c" : "test3"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "test4_1",
    "CA10A1__eksCluster__c" : "test4"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "test5_1",
    "CA10A1__eksCluster__c" : "test5"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "test6_1",
    "CA10A1__eksCluster__c" : "test6"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "test7_1",
    "CA10A1__eksCluster__c" : "test7"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "test8_1",
    "CA10A1__eksCluster__c" : "test8"
  } ];
  """;

  CREATE TEMP FUNCTION mock_CA10A1__CaAwsEksClusterNodeGroup__c()
  RETURNS ARRAY<STRUCT<
      Id STRING,
      CA10A1__disappearanceTime__c TIMESTAMP,
      CA10A1__cluster__c STRING,
      CA10A1__nodeRole__c STRING,
      context STRUCT<
          snapshotTime TIMESTAMP
      >
  >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "test1_2",
    "CA10A1__disappearanceTime__c" : new Date("2025-05-26T09:17:42Z"),
    "CA10A1__cluster__c" : "test1",
    "CA10A1__nodeRole__c" : ""
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "test2_2",
    "CA10A1__cluster__c" : "test2",
    "CA10A1__nodeRole__c" : "nodeRole2"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "test3_2",
    "CA10A1__cluster__c" : "test3",
    "CA10A1__nodeRole__c" : "nodeRole3"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "test4_2",
    "CA10A1__cluster__c" : "test4",
    "CA10A1__nodeRole__c" : ""
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "test5_2",
    "CA10A1__cluster__c" : "test5",
    "CA10A1__nodeRole__c" : "nodeRole5"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "test7_2",
    "CA10A1__cluster__c" : "test7",
    "CA10A1__nodeRole__c" : "nodeRole7"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "test8_2",
    "CA10A1__disappearanceTime__c" : new Date("2025-05-27T04:46:05Z"),
    "CA10A1__cluster__c" : "test8",
    "CA10A1__nodeRole__c" : "nodeRole8"
  } ];
  """;

  CREATE TEMP FUNCTION mock_CA10__CaAwsRole__c()
  RETURNS ARRAY<STRUCT<
      Id STRING,
      context STRUCT<
          snapshotTime TIMESTAMP
      >
  >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : null
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "nodeRole2"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "nodeRole3"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "nodeRole5"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "nodeRole7"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "nodeRole8"
  } ];
  """;

  CREATE TEMP FUNCTION mock_CA10__CaAwsIamRolePolicyAttachment__c()
  RETURNS ARRAY<STRUCT<
      Id STRING,
      CA10__disappearanceTime__c TIMESTAMP,
      CA10__policyArn__c STRING,
      CA10__role__c STRING,
      context STRUCT<
          snapshotTime TIMESTAMP
      >
  >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "test2_3",
    "CA10__policyArn__c" : "arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy",
    "CA10__role__c" : "nodeRole2"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "test3_3",
    "CA10__policyArn__c" : "arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy",
    "CA10__role__c" : "nodeRole3"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "test5_3",
    "CA10__policyArn__c" : "arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy",
    "CA10__role__c" : "nodeRole5"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-05-27T04:46:05Z")
    },
    "Id" : "test8_3",
    "CA10__policyArn__c" : "arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy",
    "CA10__role__c" : "nodeRole8"
  } ];
  """;

  CREATE TEMP FUNCTION process_CA10A1__CaAwsEksCluster__c(
      obj STRUCT<
          Id STRING,
          CA10A1__disappearanceTime__c TIMESTAMP,
          CA10A1__AWS_IAM_OpenID_Connect_Providers__r ARRAY<STRUCT<
              Id STRING,
              CA10A1__disappearanceTime__c TIMESTAMP,
              CA10A1__eksCluster__c STRING,
              result STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
          >>,
          CA10A1__AWS_EKS_Cluster_Node_Groups__r ARRAY<STRUCT<
              Id STRING,
              CA10A1__disappearanceTime__c TIMESTAMP,
              CA10A1__cluster__c STRING,
              CA10A1__nodeRole__c STRING,
              CA10A1__nodeRole__r STRUCT<
                  Id STRING,
                  CA10__AWS_IAM_Role_Policy_Attachments__r ARRAY<STRUCT<
                      Id STRING,
                      CA10__disappearanceTime__c TIMESTAMP,
                      CA10__policyArn__c STRING,
                      CA10__role__c STRING,
                      result STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
                  >>
              >,
              result STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
          >>
      >,
      snapshotTime TIMESTAMP
  )
  RETURNS STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
      var references1 = [];
      // condition[0], conditionIndex:[0..99]
      references1.push('Deleted From AWS [CA10A1__disappearanceTime__c]: ' + obj.CA10A1__disappearanceTime__c);
      if (obj.CA10A1__disappearanceTime__c != null) {
          return {status: 'DISAPPEARED', conditionIndex: 99, conditionText: "isDisappeared(CA10A1__disappearanceTime__c)", currentStateMessage: "Object is deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      var count_CA10A1__AWS_IAM_OpenID_Connect_Providers__r_COMPLIANT2 = 0;
      if (obj.CA10A1__AWS_IAM_OpenID_Connect_Providers__r != null) {
          for (var i3 = 0; i3 < obj.CA10A1__AWS_IAM_OpenID_Connect_Providers__r.length; i3++) {
              if (obj.CA10A1__AWS_IAM_OpenID_Connect_Providers__r[i3].result.status == 'COMPLIANT') {
                  count_CA10A1__AWS_IAM_OpenID_Connect_Providers__r_COMPLIANT2 += 1;
              }
          }
      }
      // condition[1], conditionIndex:[100..199]
      references1.push('Related list [CA10A1__AWS_IAM_OpenID_Connect_Providers__r] ' + (count_CA10A1__AWS_IAM_OpenID_Connect_Providers__r_COMPLIANT2 == 0 ? 'does not have' : 'has') + ' objects in COMPLIANT status');
      if (count_CA10A1__AWS_IAM_OpenID_Connect_Providers__r_COMPLIANT2 == 0) {
          return {status: 'INAPPLICABLE', conditionIndex: 199, conditionText: "CA10A1__AWS_IAM_OpenID_Connect_Providers__r.hasNo(COMPLIANT)", currentStateMessage: "The VPC CNI plugin requires an existing IAM OpenID Connect (OIDC) provider for the cluster.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      var count_CA10A1__AWS_EKS_Cluster_Node_Groups__r_INCOMPLIANT4 = 0;
      if (obj.CA10A1__AWS_EKS_Cluster_Node_Groups__r != null) {
          for (var i5 = 0; i5 < obj.CA10A1__AWS_EKS_Cluster_Node_Groups__r.length; i5++) {
              if (obj.CA10A1__AWS_EKS_Cluster_Node_Groups__r[i5].result.status == 'INCOMPLIANT') {
                  count_CA10A1__AWS_EKS_Cluster_Node_Groups__r_INCOMPLIANT4 += 1;
              }
          }
      }
      // condition[2], conditionIndex:[200..299]
      references1.push('Related list [CA10A1__AWS_EKS_Cluster_Node_Groups__r] ' + (count_CA10A1__AWS_EKS_Cluster_Node_Groups__r_INCOMPLIANT4 > 0 ? 'has' : 'does not have') + ' objects in INCOMPLIANT status');
      if (count_CA10A1__AWS_EKS_Cluster_Node_Groups__r_INCOMPLIANT4 > 0) {
          return {status: 'INCOMPLIANT', conditionIndex: 299, conditionText: "CA10A1__AWS_EKS_Cluster_Node_Groups__r.has(INCOMPLIANT)", currentStateMessage: "The EKS Cluster's node IAM role has the AmazonEKS_CNI_Policy attached.", currentStateReferences: references1.join('\n'), remediation: "Consider configuring a separate IAM role with Amazon EKS CNI policy attached and annotating the aws-node service account with this role.", runtimeError: null};
      }
      var count_CA10A1__AWS_EKS_Cluster_Node_Groups__r_COMPLIANT6 = 0;
      if (obj.CA10A1__AWS_EKS_Cluster_Node_Groups__r != null) {
          for (var i7 = 0; i7 < obj.CA10A1__AWS_EKS_Cluster_Node_Groups__r.length; i7++) {
              if (obj.CA10A1__AWS_EKS_Cluster_Node_Groups__r[i7].result.status == 'COMPLIANT') {
                  count_CA10A1__AWS_EKS_Cluster_Node_Groups__r_COMPLIANT6 += 1;
              }
          }
      }
      // condition[3], conditionIndex:[300..399]
      if (count_CA10A1__AWS_EKS_Cluster_Node_Groups__r_COMPLIANT6 > 0) {
          return {status: 'COMPLIANT', conditionIndex: 399, conditionText: "CA10A1__AWS_EKS_Cluster_Node_Groups__r.has(COMPLIANT)", currentStateMessage: "The EKS Cluster's node IAM role does not have the AmazonEKS_CNI_Policy attached", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      var count_CA10A1__AWS_EKS_Cluster_Node_Groups__r_UNDETERMINED8 = 0;
      if (obj.CA10A1__AWS_EKS_Cluster_Node_Groups__r != null) {
          for (var i9 = 0; i9 < obj.CA10A1__AWS_EKS_Cluster_Node_Groups__r.length; i9++) {
              if (obj.CA10A1__AWS_EKS_Cluster_Node_Groups__r[i9].result.status == 'UNDETERMINED') {
                  count_CA10A1__AWS_EKS_Cluster_Node_Groups__r_UNDETERMINED8 += 1;
              }
          }
      }
      // condition[4], conditionIndex:[400..499]
      if (count_CA10A1__AWS_EKS_Cluster_Node_Groups__r_UNDETERMINED8 > 0) {
          return {status: 'UNDETERMINED', conditionIndex: 499, conditionText: "CA10A1__AWS_EKS_Cluster_Node_Groups__r.has(UNDETERMINED)", currentStateMessage: "Unable to determine the EKS Cluster's Node Groups.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      var count_CA10A1__AWS_EKS_Cluster_Node_Groups__r_DISAPPEARED10 = 0;
      if (obj.CA10A1__AWS_EKS_Cluster_Node_Groups__r != null) {
          for (var i11 = 0; i11 < obj.CA10A1__AWS_EKS_Cluster_Node_Groups__r.length; i11++) {
              if (obj.CA10A1__AWS_EKS_Cluster_Node_Groups__r[i11].result.status == 'DISAPPEARED') {
                  count_CA10A1__AWS_EKS_Cluster_Node_Groups__r_DISAPPEARED10 += 1;
              }
          }
      }
      // condition[5], conditionIndex:[500..599]
      if (count_CA10A1__AWS_EKS_Cluster_Node_Groups__r_DISAPPEARED10 > 0) {
          return {status: 'DISAPPEARED', conditionIndex: 599, conditionText: "CA10A1__AWS_EKS_Cluster_Node_Groups__r.has(DISAPPEARED)", currentStateMessage: "The EKS Cluster's Node Groups are deleted in the CMDB.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      return {status: 'UNDETERMINED', conditionIndex: 600, conditionText: "otherwise", currentStateMessage: "The EKS Cluster doesn't have any Node Groups in the CMDB.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
  """;

  CREATE TEMP FUNCTION process_CA10A1__AWS_EKS_Cluster_Node_Groups__r(
      obj STRUCT<
          Id STRING,
          CA10A1__disappearanceTime__c TIMESTAMP,
          CA10A1__cluster__c STRING,
          CA10A1__nodeRole__c STRING,
          CA10A1__nodeRole__r STRUCT<
              Id STRING,
              CA10__AWS_IAM_Role_Policy_Attachments__r ARRAY<STRUCT<
                  Id STRING,
                  CA10__disappearanceTime__c TIMESTAMP,
                  CA10__policyArn__c STRING,
                  CA10__role__c STRING,
                  result STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
              >>
          >
      >,
      snapshotTime TIMESTAMP
  )
  RETURNS STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
      var references1 = [];
      // condition[0], conditionIndex:[0..99]
      references1.push('Deleted From AWS [CA10A1__disappearanceTime__c]: ' + obj.CA10A1__disappearanceTime__c);
      if (obj.CA10A1__disappearanceTime__c != null) {
          return {status: 'DISAPPEARED', conditionIndex: 99, conditionText: "isDisappeared(CA10A1__disappearanceTime__c)", currentStateMessage: "Object is deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      var count_CA10A1__nodeRole__r_CA10__AWS_IAM_Role_Policy_Attachments__r_INCOMPLIANT2 = 0;
      if (obj.CA10A1__nodeRole__r.CA10__AWS_IAM_Role_Policy_Attachments__r != null) {
          for (var i3 = 0; i3 < obj.CA10A1__nodeRole__r.CA10__AWS_IAM_Role_Policy_Attachments__r.length; i3++) {
              if (obj.CA10A1__nodeRole__r.CA10__AWS_IAM_Role_Policy_Attachments__r[i3].result.status == 'INCOMPLIANT') {
                  count_CA10A1__nodeRole__r_CA10__AWS_IAM_Role_Policy_Attachments__r_INCOMPLIANT2 += 1;
              }
          }
      }
      // condition[1], conditionIndex:[100..199]
      references1.push('Related list [CA10A1__nodeRole__r.CA10__AWS_IAM_Role_Policy_Attachments__r] ' + (count_CA10A1__nodeRole__r_CA10__AWS_IAM_Role_Policy_Attachments__r_INCOMPLIANT2 > 0 ? 'has' : 'does not have') + ' objects in INCOMPLIANT status');
      if (count_CA10A1__nodeRole__r_CA10__AWS_IAM_Role_Policy_Attachments__r_INCOMPLIANT2 > 0) {
          return {status: 'INCOMPLIANT', conditionIndex: 199, conditionText: "CA10A1__nodeRole__r.CA10__AWS_IAM_Role_Policy_Attachments__r.has(INCOMPLIANT)", currentStateMessage: "The Node Group's IAM role has the AmazonEKS_CNI_Policy attached.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      return {status: 'COMPLIANT', conditionIndex: 200, conditionText: "otherwise", currentStateMessage: "The Node Group's IAM role does not have the AmazonEKS_CNI_Policy attached.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
  """;

  CREATE TEMP FUNCTION process_CA10A1__nodeRole__r_CA10__AWS_IAM_Role_Policy_Attachments__r(
      obj STRUCT<
          Id STRING,
          CA10__disappearanceTime__c TIMESTAMP,
          CA10__policyArn__c STRING,
          CA10__role__c STRING
      >,
      snapshotTime TIMESTAMP
  )
  RETURNS STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
      var TextLib = new function () {
          this.normalize = function(arg) {
              return arg == null ? '' : arg.replace(/\s+/g, ' ').trim().toLowerCase();
          };
          this.isEmpty = function(arg) {
              return this.normalize(arg) == '';
          };
          this.isNotEmpty = function(arg) {
              return this.normalize(arg) != '';
          };
          this.equal = function(left, right) {
              return this.normalize(left) == this.normalize(right);
          };
          this.notEqual = function(left, right) {
              return this.normalize(left) != this.normalize(right);
          };
          this.startsWith = function(arg, substring) {
              return this.normalize(arg).startsWith(this.normalize(substring));
          };
          this.endsWith = function(arg, substring) {
              return this.normalize(arg).endsWith(this.normalize(substring));
          };
          this.contains = function(arg, substring) {
              return this.normalize(arg).includes(this.normalize(substring));
          };
      }();
      var references1 = [];
      // condition[0], conditionIndex:[0..99]
      references1.push('Deleted From AWS [CA10__disappearanceTime__c]: ' + obj.CA10__disappearanceTime__c);
      if (obj.CA10__disappearanceTime__c != null) {
          return {status: 'DISAPPEARED', conditionIndex: 99, conditionText: "isDisappeared(CA10__disappearanceTime__c)", currentStateMessage: "Object is deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[1], conditionIndex:[100..199]
      function extract3() { if (!this.out) { this.out = obj.CA10__policyArn__c; } return this.out; };
      references1.push('Policy ARN [obj.CA10__policyArn__c]: ' + obj.CA10__policyArn__c);
      if (TextLib.equal(extract3.call(extract3), 'arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy')) {
          return {status: 'INCOMPLIANT', conditionIndex: 199, conditionText: "extract('CA10__policyArn__c') == 'arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy'", currentStateMessage: "The AmazonEKS_CNI_Policy is attached to the node IAM role.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      return {status: 'INAPPLICABLE', conditionIndex: 200, conditionText: "otherwise", currentStateMessage: "Unrelated IAM Policy.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
  """;

  CREATE TEMP FUNCTION process_CA10A1__AWS_IAM_OpenID_Connect_Providers__r(
      obj STRUCT<
          Id STRING,
          CA10A1__disappearanceTime__c TIMESTAMP,
          CA10A1__eksCluster__c STRING
      >,
      snapshotTime TIMESTAMP
  )
  RETURNS STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
      var references1 = [];
      // condition[0], conditionIndex:[0..99]
      references1.push('Deleted From AWS [CA10A1__disappearanceTime__c]: ' + obj.CA10A1__disappearanceTime__c);
      if (obj.CA10A1__disappearanceTime__c != null) {
          return {status: 'DISAPPEARED', conditionIndex: 99, conditionText: "isDisappeared(CA10A1__disappearanceTime__c)", currentStateMessage: "Object is deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      return {status: 'COMPLIANT', conditionIndex: 100, conditionText: "otherwise", currentStateMessage: "This is an IAM OpenID Connect Provider.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
  """;


  SELECT
    expectedResult.Id as Id,
    IF (
      IFNULL(expectedResult.expectedResult.status, '') = IFNULL(sObject.result.status, '')
      AND IFNULL(expectedResult.expectedResult.conditionIndex, -1) = IFNULL(sObject.result.conditionIndex, -1)
      AND IFNULL(expectedResult.expectedResult.conditionText, '') = IFNULL(sObject.result.conditionText, '')
      AND IFNULL(expectedResult.expectedResult.runtimeError, '') = IFNULL(sObject.result.runtimeError, ''),
      "MATCH",
      "FAIL"
    ) as match,
    expectedResult.expectedResult.status as expectedStatus, sObject.result.status as actualStatus,
    expectedResult.expectedResult.conditionIndex as expectedConditionIndex, sObject.result.conditionIndex as actualConditionIndex,
    expectedResult.expectedResult.conditionText as expectedConditionText, sObject.result.conditionText as actualConditionText,
    expectedResult.expectedResult.runtimeError as expectedRuntimeError, sObject.result.runtimeError as actualRuntimeError
  FROM UNNEST(mock_ExpectedResult()) expectedResult
  LEFT JOIN (
      SELECT
          sObject.Id AS Id,
          sObject.CA10A1__disappearanceTime__c AS CA10A1__disappearanceTime__c,
          `CA10A1__AWS_IAM_OpenID_Connect_Providers__r`.arr AS CA10A1__AWS_IAM_OpenID_Connect_Providers__r,
          `CA10A1__AWS_EKS_Cluster_Node_Groups__r`.arr AS CA10A1__AWS_EKS_Cluster_Node_Groups__r,
          process_CA10A1__CaAwsEksCluster__c(
              STRUCT(
                  sObject.Id AS Id,
                  sObject.CA10A1__disappearanceTime__c AS CA10A1__disappearanceTime__c,
                  `CA10A1__AWS_IAM_OpenID_Connect_Providers__r`.arr AS CA10A1__AWS_IAM_OpenID_Connect_Providers__r,
                  `CA10A1__AWS_EKS_Cluster_Node_Groups__r`.arr AS CA10A1__AWS_EKS_Cluster_Node_Groups__r
              ),
              sObject.context.snapshotTime
          ) as result
      FROM UNNEST(mock_CA10A1__CaAwsEksCluster__c()) AS sObject
      LEFT JOIN (
          SELECT
              sObject.CA10A1__eksCluster__c,
              ARRAY_AGG(
                  STRUCT(
                      sObject.Id AS Id,
                      sObject.CA10A1__disappearanceTime__c AS CA10A1__disappearanceTime__c,
                      sObject.CA10A1__eksCluster__c AS CA10A1__eksCluster__c,
                      process_CA10A1__AWS_IAM_OpenID_Connect_Providers__r(
                          STRUCT(
                              sObject.Id AS Id,
                              sObject.CA10A1__disappearanceTime__c AS CA10A1__disappearanceTime__c,
                              sObject.CA10A1__eksCluster__c AS CA10A1__eksCluster__c
                          ),
                          sObject.context.snapshotTime
                      ) as result
                  )
              ) AS arr
          FROM UNNEST(mock_CA10A1__CaAwsIamOpenIdConnectProvider__c()) AS sObject
          GROUP BY sObject.CA10A1__eksCluster__c
      ) AS `CA10A1__AWS_IAM_OpenID_Connect_Providers__r`
          ON sObject.Id = `CA10A1__AWS_IAM_OpenID_Connect_Providers__r`.CA10A1__eksCluster__c
      LEFT JOIN (
          SELECT
              sObject.CA10A1__cluster__c,
              ARRAY_AGG(
                  STRUCT(
                      sObject.Id AS Id,
                      sObject.CA10A1__disappearanceTime__c AS CA10A1__disappearanceTime__c,
                      sObject.CA10A1__cluster__c AS CA10A1__cluster__c,
                      sObject.CA10A1__nodeRole__c AS CA10A1__nodeRole__c,
                      STRUCT (
                          `CA10A1__nodeRole__r`.Id AS Id,
                          `CA10A1__nodeRole__r.CA10__AWS_IAM_Role_Policy_Attachments__r`.arr AS CA10__AWS_IAM_Role_Policy_Attachments__r
                      ) AS CA10A1__nodeRole__r,
                      process_CA10A1__AWS_EKS_Cluster_Node_Groups__r(
                          STRUCT(
                              sObject.Id AS Id,
                              sObject.CA10A1__disappearanceTime__c AS CA10A1__disappearanceTime__c,
                              sObject.CA10A1__cluster__c AS CA10A1__cluster__c,
                              sObject.CA10A1__nodeRole__c AS CA10A1__nodeRole__c,
                              STRUCT (
                                  `CA10A1__nodeRole__r`.Id AS Id,
                                  `CA10A1__nodeRole__r.CA10__AWS_IAM_Role_Policy_Attachments__r`.arr AS CA10__AWS_IAM_Role_Policy_Attachments__r
                              ) AS CA10A1__nodeRole__r
                          ),
                          sObject.context.snapshotTime
                      ) as result
                  )
              ) AS arr
          FROM UNNEST(mock_CA10A1__CaAwsEksClusterNodeGroup__c()) AS sObject
          LEFT JOIN UNNEST(mock_CA10__CaAwsRole__c()) AS `CA10A1__nodeRole__r`
              ON sObject.CA10A1__nodeRole__c = `CA10A1__nodeRole__r`.Id
          LEFT JOIN (
              SELECT
                  sObject.CA10__role__c,
                  ARRAY_AGG(
                      STRUCT(
                          sObject.Id AS Id,
                          sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
                          sObject.CA10__policyArn__c AS CA10__policyArn__c,
                          sObject.CA10__role__c AS CA10__role__c,
                          process_CA10A1__nodeRole__r_CA10__AWS_IAM_Role_Policy_Attachments__r(
                              STRUCT(
                                  sObject.Id AS Id,
                                  sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
                                  sObject.CA10__policyArn__c AS CA10__policyArn__c,
                                  sObject.CA10__role__c AS CA10__role__c
                              ),
                              sObject.context.snapshotTime
                          ) as result
                      )
                  ) AS arr
              FROM UNNEST(mock_CA10__CaAwsIamRolePolicyAttachment__c()) AS sObject
              GROUP BY sObject.CA10__role__c
          ) AS `CA10A1__nodeRole__r.CA10__AWS_IAM_Role_Policy_Attachments__r`
              ON `CA10A1__nodeRole__r`.Id = `CA10A1__nodeRole__r.CA10__AWS_IAM_Role_Policy_Attachments__r`.CA10__role__c
          GROUP BY sObject.CA10A1__cluster__c
      ) AS `CA10A1__AWS_EKS_Cluster_Node_Groups__r`
          ON sObject.Id = `CA10A1__AWS_EKS_Cluster_Node_Groups__r`.CA10A1__cluster__c
  ) sObject ON sObject.Id = expectedResult.Id;
