---
policy: /ce/ca/google/compute-engine/instance-public-ip
logic: /ce/ca/google/compute-engine/instance-public-ip/prod.logic.yaml
executionTime: 2025-04-24T23:46:52.872161508Z
rows:
  - id: a4Z1
    match: true
    status:
      expected: DISAPPEARED
      actual: DISAPPEARED
    conditionIndex:
      expected: 99
      actual: 99
    conditionText:
      expected: isDisappeared(CA10__disappearanceTime__c)
      actual: isDisappeared(CA10__disappearanceTime__c)
    runtimeError: {}
  - id: a4Z2G
    match: true
    status:
      expected: INAPPLICABLE
      actual: INAPPLICABLE
    conditionIndex:
      expected: 199
      actual: 199
    conditionText:
      expected: extract('Name').startsWith('gke-')
      actual: extract('Name').startsWith('gke-')
    runtimeError: {}
  - id: a4Z3
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 299
      actual: 299
    conditionText:
      expected: CA10__Google_GCE_Network_Interfaces__r.has(INCOMPLIANT)
      actual: CA10__Google_GCE_Network_Interfaces__r.has(INCOMPLIANT)
    runtimeError: {}
  - id: a4Z4
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 300
      actual: 300
    conditionText:
      expected: otherwise
      actual: otherwise
    runtimeError: {}
usedFiles:
  - path: /ce/ca/google/compute-engine/instance-public-ip/policy.yaml
    md5Hash: 3B90DC890DB9A8E502EC6BB224991E7E
    content: "---\nnames: \n  full: \"Google GCE Instance has a public IP address\"\
      \n  contextual: \"Instance has a public IP address\"\ndescription: \"Compute\
      \ instances should not be configured to have external IP addresses.\"\ntype:\
      \ COMPLIANCE_POLICY\ncategories:\n  - \"SECURITY\"\nframeworkMappings:\n  -\
      \ /frameworks/cis-gcp-v3.0.0/04/09\n  - /frameworks/cloudaware/resource-security/public-and-anonymous-access\n\
      similarPolicies:\n  cloudConformity:\n    - url: \"https://www.trendmicro.com/cloudoneconformity-staging/knowledge-base/gcp/ComputeEngine/instances-with-public-ip-addresses.html\"\
      \n      name: \"Check for Virtual Machine Instances with Public IP Addresses\"\
      \n"
  - path: /ce/ca/google/compute-engine/instance-public-ip/prod.logic.yaml
    md5Hash: BAF2CA71AF20B458D478CC284861BAE0
    content: "---\ninputType: \"CA10__CaGoogleGceInstance__c\"\ntestData:\n  - file:\
      \ test-data.json\nimportExtracts:\n  - file: /types/CA10__CaGoogleGceInstance__c/object.extracts.yaml\n\
      conditions:\n  - status: \"INAPPLICABLE\"\n    currentStateMessage: \"This instance\
      \ is created by GKE.\"\n    check:\n      STARTS_WITH:\n        arg:\n     \
      \     EXTRACT: \"Name\"\n        prefix:\n          TEXT: 'gke-'\n  - status:\
      \ \"INCOMPLIANT\"\n    currentStateMessage: \"This instance has a public IP\
      \ address.\"\n    remediationMessage: \"Delete the public access config.\"\n\
      \    check:\n      RELATED_LIST_HAS:\n        status: \"INCOMPLIANT\"\n    \
      \    relationshipName: \"CA10__Google_GCE_Network_Interfaces__r\"\notherwise:\n\
      \  status: \"COMPLIANT\"\n  currentStateMessage: \"The instance doesn't have\
      \ a public IP address.\"\nrelatedLists:\n  - relationshipName: \"CA10__Google_GCE_Network_Interfaces__r\"\
      \n    importExtracts:\n      - file: /types/CA10__CaGoogleGceNetworkInterface__c/object.extracts.yaml\n\
      \    conditions: \n      - status: \"INCOMPLIANT\"\n        currentStateMessage:\
      \ \"The Network Interface has an External IP address attached.\"\n        check:\n\
      \          NOT_EMPTY:\n            arg:\n              EXTRACT: \"CA10__externalIp__c\"\
      \n    otherwise:\n      status: \"COMPLIANT\"\n      currentStateMessage: \"\
      The Network Interface doesn't have an External IP address attached.\""
  - path: /types/CA10__CaGoogleGceNetworkInterface__c/object.extracts.yaml
    md5Hash: B3889AA90224A8197852FFE40137C8AB
    content: "---\nextracts:\n  - name: \"CA10__externalIp__c\"\n    value: \n   \
      \   FIELD:\n        path: \"CA10__externalIp__c\"\n"
  - path: /types/CA10__CaGoogleGceInstance__c/object.extracts.yaml
    md5Hash: 95F28CC49887E4035F2848BC20DC25D1
    content: "---\nextracts:\n  - name: \"Name\"\n    value: \n      FIELD:\n    \
      \    path: \"Name\"\n        undeterminedIf:\n          isEmpty:  \"Name should\
      \ not be empty\"\n  - name: \"CA10__labels__c\"\n    value: \n      FIELD:\n\
      \        path: \"CA10__labels__c\"\n        undeterminedIf:\n          isEmpty:\
      \  \"Labels should not be empty\"\n  - name: \"CA10__ipForwarding__c\"\n   \
      \ value: \n      FIELD:\n        path: \"CA10__ipForwarding__c\"\n        undeterminedIf:\n\
      \          isEmpty: \"IP forwarding can't be empty\"\n  - name: \"CA10__shieldedIntegrityMonitoringState__c\"\
      \n    value: \n      FIELD:\n        path: \"CA10__shieldedIntegrityMonitoringState__c\"\
      \n  - name: \"CA10__shieldedVtpmState__c\"\n    value: \n      FIELD:\n    \
      \    path: \"CA10__shieldedVtpmState__c\"\n  - name: \"CA10__confidentialComputeStatus__c\"\
      \n    value: \n      FIELD:\n        path: \"CA10__confidentialComputeStatus__c\"\
      \n  - name: \"CA10__machineTypeName__c\"\n    value: \n      FIELD:\n      \
      \  path: \"CA10__machineTypeName__c\"\n  - name: \"CA10__metadataJson__c\"\n\
      \    value: \n      FIELD:\n        path: \"CA10__metadataJson__c\"\n      \
      \  returnType: BYTES\n  - name: \"caJsonFrom__metadataJson__c\"\n    value:\
      \ \n      JSON_FROM:\n        arg: \n          EXTRACT: \"CA10__metadataJson__c\"\
      \n        undeterminedIf:\n          isInvalid: \"Metadata JSON is invalid.\"\
      \n          isEmpty: \"Metadata JSON is empty.\"\n  - name: \"caJsonFrom__metadataJson__block_project_ssh_keys_value\"\
      \n    value: \n      JSON_QUERY_TEXT:\n        arg:\n          EXTRACT: \"caJsonFrom__metadataJson__c\"\
      \n        expression: \"to_string(items[?key=='block-project-ssh-keys'].value)\"\
      \n        undeterminedIf:\n          evaluationError: \"The JSON query has failed.\"\
      \n          resultTypeMismatch: \"The JSON query did not return a text.\"\n\
      \          resultIsEmpty: \"The JSON query did not return a value.\"\n  - name:\
      \ \"caJsonFrom__metadataJson__enable_oslogin_value\"\n    value: \n      JSON_QUERY_TEXT:\n\
      \        arg:\n          EXTRACT: \"caJsonFrom__metadataJson__c\"\n        expression:\
      \ \"to_string(items[?key=='enable-oslogin'].value)\"\n        undeterminedIf:\n\
      \          evaluationError: \"The JSON query has failed.\"\n          resultTypeMismatch:\
      \ \"The JSON query did not return a text.\"\n          resultIsEmpty: \"The\
      \ JSON query did not return a value.\"\n  - name: \"caJsonFrom__metadataJson__serial_port_enable_value\"\
      \n    value: \n      JSON_QUERY_TEXT:\n        arg:\n          EXTRACT: \"caJsonFrom__metadataJson__c\"\
      \n        expression: \"to_string(items[?key=='serial-port-enable'].value)\"\
      \n        undeterminedIf:\n          evaluationError: \"The JSON query has failed.\"\
      \n          resultTypeMismatch: \"The JSON query did not return a text.\"\n\
      \          resultIsEmpty: \"The JSON query did not return a value.\"\n"
  - path: /ce/ca/google/compute-engine/instance-public-ip/test-data.json
    md5Hash: 36427D43184C23E3E210884A822388B3
    content: |
      [
        {
          "expectedResult": {
            "status": "DISAPPEARED",
            "conditionIndex": "99",
            "conditionText": "isDisappeared(CA10__disappearanceTime__c)",
            "runtimeError": null
          },
          "context": { "snapshotTime": "2024-09-02T17:45:22Z" },
          "Id": "a4Z1",
          "CA10__disappearanceTime__c": "2024-08-25T08:14:56Z",
          "Name": "d-amazon",
          "CA10__labels__c": "",
          "CA10__Google_GCE_Network_Interfaces__r": [ ]
        },
        {
          "expectedResult": {
            "status": "INAPPLICABLE",
            "conditionIndex": "199",
            "conditionText": "extract('Name').startsWith('gke-')",
            "runtimeError": null
          },
          "context": { "snapshotTime": "2024-09-02T17:45:22Z" },
          "Id": "a4Z2G",
          "CA10__disappearanceTime__c": null,
          "Name": "gke-camel-default",
          "CA10__labels__c": "goog-gke-node:",
          "CA10__Google_GCE_Network_Interfaces__r": [ ]
        },
        {
          "expectedResult": {
            "status": "INCOMPLIANT",
            "conditionIndex": "299",
            "conditionText": "CA10__Google_GCE_Network_Interfaces__r.has(INCOMPLIANT)",
            "runtimeError": null
          },
          "context": { "snapshotTime": "2024-09-02T17:45:22Z" },
          "Id": "a4Z3",
          "CA10__disappearanceTime__c": null,
          "Name": "image",
          "CA10__labels__c": "instance-name: image",
          "CA10__Google_GCE_Network_Interfaces__r": [
            {
              "Id": "a4a0111",
              "CA10__disappearanceTime__c": null,
              "CA10__externalIp__c": "35.190.155.4",
              "CA10__gceInstance__c": "a4Z3"
            }
          ]
        },
        {
          "expectedResult": {
            "status": "COMPLIANT",
            "conditionIndex": "300",
            "conditionText": "otherwise",
            "runtimeError": null
          },
          "context": { "snapshotTime": "2024-09-02T17:45:22Z" },
          "Id": "a4Z4",
          "CA10__disappearanceTime__c": null,
          "Name": "esxi4",
          "CA10__labels__c": "",
          "CA10__Google_GCE_Network_Interfaces__r": [
            {
              "Id": "a4a044",
              "CA10__disappearanceTime__c": null,
              "CA10__externalIp__c": "",
              "CA10__gceInstance__c": "a4Z4"
            }
          ]
        }
      ]
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" : "a4Z1",
    "expectedResult" : {
      "status" : "DISAPPEARED",
      "conditionIndex" : "99",
      "conditionText" : "isDisappeared(CA10__disappearanceTime__c)",
      "runtimeError" : null
    }
  }, {
    "Id" : "a4Z2G",
    "expectedResult" : {
      "status" : "INAPPLICABLE",
      "conditionIndex" : "199",
      "conditionText" : "extract('Name').startsWith('gke-')",
      "runtimeError" : null
    }
  }, {
    "Id" : "a4Z3",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "299",
      "conditionText" : "CA10__Google_GCE_Network_Interfaces__r.has(INCOMPLIANT)",
      "runtimeError" : null
    }
  }, {
    "Id" : "a4Z4",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : "300",
      "conditionText" : "otherwise",
      "runtimeError" : null
    }
  } ];
  """;

  CREATE TEMP FUNCTION mock_CA10__CaGoogleGceInstance__c()
  RETURNS ARRAY<STRUCT<
      Id STRING,
      CA10__disappearanceTime__c TIMESTAMP,
      Name STRING,
      context STRUCT<
          snapshotTime TIMESTAMP
      >
  >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "context" : {
      "snapshotTime" : new Date("2024-09-02T17:45:22Z")
    },
    "Id" : "a4Z1",
    "CA10__disappearanceTime__c" : new Date("2024-08-25T08:14:56Z"),
    "Name" : "d-amazon"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-09-02T17:45:22Z")
    },
    "Id" : "a4Z2G",
    "Name" : "gke-camel-default"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-09-02T17:45:22Z")
    },
    "Id" : "a4Z3",
    "Name" : "image"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-09-02T17:45:22Z")
    },
    "Id" : "a4Z4",
    "Name" : "esxi4"
  } ];
  """;

  CREATE TEMP FUNCTION mock_CA10__CaGoogleGceNetworkInterface__c()
  RETURNS ARRAY<STRUCT<
      Id STRING,
      CA10__disappearanceTime__c TIMESTAMP,
      CA10__externalIp__c STRING,
      CA10__gceInstance__c STRING,
      context STRUCT<
          snapshotTime TIMESTAMP
      >
  >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "context" : {
      "snapshotTime" : new Date("2024-09-02T17:45:22Z")
    },
    "Id" : "a4a0111",
    "CA10__externalIp__c" : "35.190.155.4",
    "CA10__gceInstance__c" : "a4Z3"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-09-02T17:45:22Z")
    },
    "Id" : "a4a044",
    "CA10__externalIp__c" : "",
    "CA10__gceInstance__c" : "a4Z4"
  } ];
  """;

  CREATE TEMP FUNCTION process_CA10__CaGoogleGceInstance__c(
      obj STRUCT<
          Id STRING,
          CA10__disappearanceTime__c TIMESTAMP,
          Name STRING,
          CA10__Google_GCE_Network_Interfaces__r ARRAY<STRUCT<
              Id STRING,
              CA10__disappearanceTime__c TIMESTAMP,
              CA10__externalIp__c STRING,
              CA10__gceInstance__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 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 Google [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 fieldChecked4() {
          if (TextLib.isEmpty(obj.Name)) {
              throw new Error("UNDETERMINED condition:101", {cause: {status: 'UNDETERMINED', conditionIndex: 101, conditionText: "Name.isEmpty()", currentStateMessage: "Name should not be empty", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}});
          }
          return obj.Name;
      }
      function extract3() { if (!this.out) { this.out = fieldChecked4(); } return this.out; };
      references1.push('Name [obj.Name]: ' + obj.Name);
      try {
          if (TextLib.startsWith(extract3.call(extract3), 'gke-')) {
              return {status: 'INAPPLICABLE', conditionIndex: 199, conditionText: "extract('Name').startsWith('gke-')", currentStateMessage: "This instance is created by GKE.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
          }
      } catch (err) {
          if (err.cause && err.cause.status) { return err.cause; } else { throw err; }
      }
      var count_CA10__Google_GCE_Network_Interfaces__r_INCOMPLIANT5 = 0;
      if (obj.CA10__Google_GCE_Network_Interfaces__r != null) {
          for (var i6 = 0; i6 < obj.CA10__Google_GCE_Network_Interfaces__r.length; i6++) {
              if (obj.CA10__Google_GCE_Network_Interfaces__r[i6].result.status == 'INCOMPLIANT') {
                  count_CA10__Google_GCE_Network_Interfaces__r_INCOMPLIANT5 += 1;
              }
          }
      }
      // condition[2], conditionIndex:[200..299]
      references1.push('Related list [CA10__Google_GCE_Network_Interfaces__r] ' + (count_CA10__Google_GCE_Network_Interfaces__r_INCOMPLIANT5 > 0 ? 'has' : 'does not have') + ' objects in INCOMPLIANT status');
      if (count_CA10__Google_GCE_Network_Interfaces__r_INCOMPLIANT5 > 0) {
          return {status: 'INCOMPLIANT', conditionIndex: 299, conditionText: "CA10__Google_GCE_Network_Interfaces__r.has(INCOMPLIANT)", currentStateMessage: "This instance has a public IP address.", currentStateReferences: references1.join('\n'), remediation: "Delete the public access config.", runtimeError: null};
      }
      return {status: 'COMPLIANT', conditionIndex: 300, conditionText: "otherwise", currentStateMessage: "The instance doesn't have a public IP address.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
  """;

  CREATE TEMP FUNCTION process_CA10__Google_GCE_Network_Interfaces__r(
      obj STRUCT<
          Id STRING,
          CA10__disappearanceTime__c TIMESTAMP,
          CA10__externalIp__c STRING,
          CA10__gceInstance__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 Google [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__externalIp__c; } return this.out; };
      references1.push('External IP [obj.CA10__externalIp__c]: ' + obj.CA10__externalIp__c);
      if (TextLib.isNotEmpty(extract3.call(extract3))) {
          return {status: 'INCOMPLIANT', conditionIndex: 199, conditionText: "extract('CA10__externalIp__c').isNotEmpty()", currentStateMessage: "The Network Interface has an External IP address attached.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      return {status: 'COMPLIANT', conditionIndex: 200, conditionText: "otherwise", currentStateMessage: "The Network Interface doesn't have an External IP address attached.", 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.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
          sObject.Name AS Name,
          `CA10__Google_GCE_Network_Interfaces__r`.arr AS CA10__Google_GCE_Network_Interfaces__r,
          process_CA10__CaGoogleGceInstance__c(
              STRUCT(
                  sObject.Id AS Id,
                  sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
                  sObject.Name AS Name,
                  `CA10__Google_GCE_Network_Interfaces__r`.arr AS CA10__Google_GCE_Network_Interfaces__r
              ),
              sObject.context.snapshotTime
          ) as result
      FROM UNNEST(mock_CA10__CaGoogleGceInstance__c()) AS sObject
      LEFT JOIN (
          SELECT
              sObject.CA10__gceInstance__c,
              ARRAY_AGG(
                  STRUCT(
                      sObject.Id AS Id,
                      sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
                      sObject.CA10__externalIp__c AS CA10__externalIp__c,
                      sObject.CA10__gceInstance__c AS CA10__gceInstance__c,
                      process_CA10__Google_GCE_Network_Interfaces__r(
                          STRUCT(
                              sObject.Id AS Id,
                              sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
                              sObject.CA10__externalIp__c AS CA10__externalIp__c,
                              sObject.CA10__gceInstance__c AS CA10__gceInstance__c
                          ),
                          sObject.context.snapshotTime
                      ) as result
                  )
              ) AS arr
          FROM UNNEST(mock_CA10__CaGoogleGceNetworkInterface__c()) AS sObject
          GROUP BY sObject.CA10__gceInstance__c
      ) AS `CA10__Google_GCE_Network_Interfaces__r`
          ON sObject.Id = `CA10__Google_GCE_Network_Interfaces__r`.CA10__gceInstance__c
  ) sObject ON sObject.Id = expectedResult.Id;
