---
policy: /ce/ca/aws/secrets-manager/secret-unused
logic: /ce/ca/aws/secrets-manager/secret-unused/prod.logic.yaml
executionTime: 2026-01-24T12:02:27.261421667Z
generationMs: 49
executionMs: 736
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: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 299
      actual: 299
    conditionText:
      expected: extract('CA10A1__lastAccessedDate__c').isEmpty() && extract('CA10A1__lastChangedDate__c').beyondLastDays(90)
      actual: extract('CA10A1__lastAccessedDate__c').isEmpty() && extract('CA10A1__lastChangedDate__c').beyondLastDays(90)
    runtimeError: {}
  - id: test3
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 399
      actual: 399
    conditionText:
      expected: extract('CA10A1__lastAccessedDate__c').beyondLastDays(90) && extract('CA10A1__lastRotatedDate__c').isEmpty()
      actual: extract('CA10A1__lastAccessedDate__c').beyondLastDays(90) && extract('CA10A1__lastRotatedDate__c').isEmpty()
    runtimeError: {}
  - id: test4
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 500
      actual: 500
    conditionText:
      expected: otherwise
      actual: otherwise
    runtimeError: {}
  - id: test5
    match: true
    status:
      expected: INAPPLICABLE
      actual: INAPPLICABLE
    conditionIndex:
      expected: 199
      actual: 199
    conditionText:
      expected: extract('CA10A1__deletedDate__c').isNotEmpty()
      actual: extract('CA10A1__deletedDate__c').isNotEmpty()
    runtimeError: {}
  - id: test6
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 499
      actual: 499
    conditionText:
      expected: extract('CA10A1__lastAccessedDate__c').beyondLastDays(90) && extract('CA10A1__lastRotatedDate__c').beyondLastDays(90)
      actual: extract('CA10A1__lastAccessedDate__c').beyondLastDays(90) && extract('CA10A1__lastRotatedDate__c').beyondLastDays(90)
    runtimeError: {}
usedFiles:
  - path: /ce/ca/aws/secrets-manager/secret-unused/policy.yaml
    md5Hash: 7F15788C38540F61B9FC4D3370FE01C3
    content: "---\nnames:\n  full: \"AWS Secrets Manager Secret has not been accessed\
      \ in over 90 days\"\n  contextual: \"Secret has not been accessed in over 90\
      \ days\"\ndescription: >\n  Identify AWS Secrets Manager secrets that have not\
      \ been accessed for more than 90 days. \n  Unused secrets should be reviewed\
      \ for deletion or rotation to reduce the attack \n  surface and minimize costs.\n\
      type: \"COMPLIANCE_POLICY\"\ncategories:\n  - \"SECURITY\"\nframeworkMappings:\n\
      \  - \"/frameworks/cloudaware/secret-and-certificate-governance/expiration-management\"\
      \n  - \"/frameworks/aws-fsbp-v1.0.0/secrets-manager/03\"\nsimilarPolicies:\n\
      \  awsSecurityHub:\n    - name: \"[SecretsManager.3] Remove unused Secrets Manager\
      \ secrets\"\n      url: \"https://docs.aws.amazon.com/securityhub/latest/userguide/secretsmanager-controls.html#secretsmanager-3\""
  - path: /ce/ca/aws/secrets-manager/secret-unused/prod.logic.yaml
    md5Hash: 11C59755F554B56463EA2110F275081E
    content: |
      ---
      inputType: "CA10A1__CaAwsSecretsManagerSecret__c"
      testData:
        - file: "test-data.json"
      importExtracts:
        - file: "/types/CA10A1__CaAwsSecretsManagerSecret__c/object.extracts.yaml"
      conditions:
        - status: "INAPPLICABLE"
          currentStateMessage: "This secret is not active."
          check:
            NOT_EMPTY:
              arg:
                EXTRACT: "CA10A1__deletedDate__c"
        - status: "INCOMPLIANT"
          currentStateMessage: "The Secret has never been accessed and last change occurred more than 90 days ago."
          remediationMessage: "Determine if this secret is still required by any application. If not, consider deleting it."
          check:
            AND:
              args:
                - IS_EMPTY:
                    arg:
                      EXTRACT: "CA10A1__lastAccessedDate__c"
                - IS_BEYOND_LAST_DAYS:
                    offsetDays: 90
                    arg:
                      EXTRACT: "CA10A1__lastChangedDate__c"
        - status: "INCOMPLIANT"
          currentStateMessage: "The secret was last accessed more than 90 days ago and never rotated."
          remediationMessage: "Determine if this secret is still required by any application. If not, consider deleting it."
          check:
            AND:
              args:
                - IS_BEYOND_LAST_DAYS:
                    offsetDays: 90
                    arg:
                      EXTRACT: "CA10A1__lastAccessedDate__c"
                - IS_EMPTY:
                    arg:
                      EXTRACT: "CA10A1__lastRotatedDate__c"
        - status: "INCOMPLIANT"
          currentStateMessage: "The secret was last accessed and rotated more than 90 days ago."
          remediationMessage: "Determine if this secret is still required by any application. If not, consider deleting it."
          check:
            AND:
              args:
                - IS_BEYOND_LAST_DAYS:
                    offsetDays: 90
                    arg:
                      EXTRACT: "CA10A1__lastAccessedDate__c"
                - IS_BEYOND_LAST_DAYS:
                    offsetDays: 90
                    arg:
                      EXTRACT: "CA10A1__lastRotatedDate__c"
      otherwise:
        status: "COMPLIANT"
        currentStateMessage: "The secret has been accessed, changed, or rotated within the last 90 days."
  - path: /ce/ca/aws/secrets-manager/secret-unused/test-data.json
    md5Hash: 7BCFE02717A6D720643760A6C97AEB6A
    content: |-
      [
          {
              "CA10A1__deletedDate__c": null,
              "CA10A1__lastAccessedDate__c": "2026-01-13T00:00:00Z",
              "expectedResult": {
                  "runtimeError": null,
                  "conditionText": "isDisappeared(CA10A1__disappearanceTime__c)",
                  "conditionIndex": 99,
                  "status": "DISAPPEARED"
              },
              "CA10A1__disappearanceTime__c": "2026-01-14T15:24:57Z",
              "CA10A1__lastRotatedDate__c": null,
              "context": {
                  "snapshotTime": "2026-01-19T05:26:35Z"
              },
              "Id": "test1",
              "CA10A1__lastChangedDate__c": "2025-08-08T16:23:14Z"
          },
          {
              "CA10A1__deletedDate__c": null,
              "CA10A1__lastAccessedDate__c": null,
              "expectedResult": {
                  "runtimeError": null,
                  "conditionText": "extract('CA10A1__lastAccessedDate__c').isEmpty() && extract('CA10A1__lastChangedDate__c').beyondLastDays(90)",
                  "conditionIndex": 299,
                  "status": "INCOMPLIANT"
              },
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__lastRotatedDate__c": null,
              "context": {
                  "snapshotTime": "2026-01-19T05:26:35Z"
              },
              "Id": "test2",
              "CA10A1__lastChangedDate__c": "2025-07-21T21:16:52Z"
          },
          {
              "CA10A1__deletedDate__c": null,
              "CA10A1__lastAccessedDate__c": "2025-07-21T00:00:00Z",
              "expectedResult": {
                  "runtimeError": null,
                  "conditionText": "extract('CA10A1__lastAccessedDate__c').beyondLastDays(90) && extract('CA10A1__lastRotatedDate__c').isEmpty()",
                  "conditionIndex": 399,
                  "status": "INCOMPLIANT"
              },
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__lastRotatedDate__c": null,
              "context": {
                  "snapshotTime": "2026-01-19T05:26:35Z"
              },
              "Id": "test3",
              "CA10A1__lastChangedDate__c": "2025-07-20T19:16:13Z"
          },
          {
              "CA10A1__deletedDate__c": null,
              "CA10A1__lastAccessedDate__c": "2026-01-14T00:00:00Z",
              "expectedResult": {
                  "runtimeError": null,
                  "conditionText": "otherwise",
                  "conditionIndex": 500,
                  "status": "COMPLIANT"
              },
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__lastRotatedDate__c": null,
              "context": {
                  "snapshotTime": "2026-01-19T05:26:35Z"
              },
              "Id": "test4",
              "CA10A1__lastChangedDate__c": "2025-07-20T04:59:04Z"
          },
          {
              "CA10A1__deletedDate__c": "2026-01-19T05:26:35Z",
              "CA10A1__lastAccessedDate__c": null,
              "expectedResult": {
                  "runtimeError": null,
                  "conditionText": "extract('CA10A1__deletedDate__c').isNotEmpty()",
                  "conditionIndex": 199,
                  "status": "INAPPLICABLE"
              },
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__lastRotatedDate__c": null,
              "context": {
                  "snapshotTime": "2026-01-19T05:26:35Z"
              },
              "Id": "test5",
              "CA10A1__lastChangedDate__c": "2025-07-21T21:16:52Z"
          },
          {
              "CA10A1__deletedDate__c": null,
              "CA10A1__lastAccessedDate__c": "2025-07-21T00:00:00Z",
              "expectedResult": {
                  "runtimeError": null,
                  "conditionText": "extract('CA10A1__lastAccessedDate__c').beyondLastDays(90) && extract('CA10A1__lastRotatedDate__c').beyondLastDays(90)",
                  "conditionIndex": 499,
                  "status": "INCOMPLIANT"
              },
              "CA10A1__disappearanceTime__c": null,
              "CA10A1__lastRotatedDate__c": "2025-07-21T00:00:00Z",
              "context": {
                  "snapshotTime": "2026-01-19T05:26:35Z"
              },
              "Id": "test6",
              "CA10A1__lastChangedDate__c": "2025-07-20T19:16:13Z"
          }
      ]
  - path: /types/CA10A1__CaAwsSecretsManagerSecret__c/object.extracts.yaml
    md5Hash: EE2C582B7F073CDD9BCEC537B36DB97A
    content: "---\nextracts:\n# Nullable. Can't have no access, retrieved via secretsmanager:ListSecrets\n\
      \  - name: CA10A1__deletedDate__c\n    value:\n      FIELD: \n        path:\
      \ CA10A1__deletedDate__c\n# Checkbox. Can't have no access, retrieved via secretsmanager:ListSecrets\n\
      \  - name: CA10A1__rotationEnabled__c\n    value:\n      FIELD: \n        path:\
      \ CA10A1__rotationEnabled__c\n# Nullable. Can't have no access, retrieved via\
      \ secretsmanager:ListSecrets\n  - name: CA10A1__lastAccessedDate__c\n    value:\n\
      \      FIELD: \n        path: CA10A1__lastAccessedDate__c\n# Not nullable. Can't\
      \ have no access, retrieved via secretsmanager:ListSecrets\n  - name: CA10A1__lastChangedDate__c\n\
      \    value:\n      FIELD: \n        path: CA10A1__lastChangedDate__c\n# Nullable.\
      \ Can't have no access, retrieved via secretsmanager:ListSecrets\n  - name:\
      \ CA10A1__lastRotatedDate__c\n    value:\n      FIELD: \n        path: CA10A1__lastRotatedDate__c\n"
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" : {
      "runtimeError" : null,
      "conditionText" : "isDisappeared(CA10A1__disappearanceTime__c)",
      "conditionIndex" : 99,
      "status" : "DISAPPEARED"
    }
  }, {
    "Id" : "test2",
    "expectedResult" : {
      "runtimeError" : null,
      "conditionText" : "extract('CA10A1__lastAccessedDate__c').isEmpty() && extract('CA10A1__lastChangedDate__c').beyondLastDays(90)",
      "conditionIndex" : 299,
      "status" : "INCOMPLIANT"
    }
  }, {
    "Id" : "test3",
    "expectedResult" : {
      "runtimeError" : null,
      "conditionText" : "extract('CA10A1__lastAccessedDate__c').beyondLastDays(90) && extract('CA10A1__lastRotatedDate__c').isEmpty()",
      "conditionIndex" : 399,
      "status" : "INCOMPLIANT"
    }
  }, {
    "Id" : "test4",
    "expectedResult" : {
      "runtimeError" : null,
      "conditionText" : "otherwise",
      "conditionIndex" : 500,
      "status" : "COMPLIANT"
    }
  }, {
    "Id" : "test5",
    "expectedResult" : {
      "runtimeError" : null,
      "conditionText" : "extract('CA10A1__deletedDate__c').isNotEmpty()",
      "conditionIndex" : 199,
      "status" : "INAPPLICABLE"
    }
  }, {
    "Id" : "test6",
    "expectedResult" : {
      "runtimeError" : null,
      "conditionText" : "extract('CA10A1__lastAccessedDate__c').beyondLastDays(90) && extract('CA10A1__lastRotatedDate__c').beyondLastDays(90)",
      "conditionIndex" : 499,
      "status" : "INCOMPLIANT"
    }
  } ];
  """;

  CREATE TEMP FUNCTION mock_CA10A1__CaAwsSecretsManagerSecret__c()
  RETURNS ARRAY<STRUCT<
      CA10A1__disappearanceTime__c TIMESTAMP,
      CA10A1__deletedDate__c TIMESTAMP,
      CA10A1__lastAccessedDate__c TIMESTAMP,
      CA10A1__lastChangedDate__c TIMESTAMP,
      CA10A1__lastRotatedDate__c TIMESTAMP,
      Id STRING,
      context STRUCT<
          snapshotTime TIMESTAMP
      >
  >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "context" : {
      "snapshotTime" : new Date("2026-01-19T05:26:35Z")
    },
    "CA10A1__disappearanceTime__c" : new Date("2026-01-14T15:24:57Z"),
    "CA10A1__lastAccessedDate__c" : new Date("2026-01-13T00:00:00Z"),
    "CA10A1__lastChangedDate__c" : new Date("2025-08-08T16:23:14Z"),
    "Id" : "test1"
  }, {
    "context" : {
      "snapshotTime" : new Date("2026-01-19T05:26:35Z")
    },
    "CA10A1__lastChangedDate__c" : new Date("2025-07-21T21:16:52Z"),
    "Id" : "test2"
  }, {
    "context" : {
      "snapshotTime" : new Date("2026-01-19T05:26:35Z")
    },
    "CA10A1__lastAccessedDate__c" : new Date("2025-07-21T00:00:00Z"),
    "CA10A1__lastChangedDate__c" : new Date("2025-07-20T19:16:13Z"),
    "Id" : "test3"
  }, {
    "context" : {
      "snapshotTime" : new Date("2026-01-19T05:26:35Z")
    },
    "CA10A1__lastAccessedDate__c" : new Date("2026-01-14T00:00:00Z"),
    "CA10A1__lastChangedDate__c" : new Date("2025-07-20T04:59:04Z"),
    "Id" : "test4"
  }, {
    "context" : {
      "snapshotTime" : new Date("2026-01-19T05:26:35Z")
    },
    "CA10A1__deletedDate__c" : new Date("2026-01-19T05:26:35Z"),
    "CA10A1__lastChangedDate__c" : new Date("2025-07-21T21:16:52Z"),
    "Id" : "test5"
  }, {
    "context" : {
      "snapshotTime" : new Date("2026-01-19T05:26:35Z")
    },
    "CA10A1__lastAccessedDate__c" : new Date("2025-07-21T00:00:00Z"),
    "CA10A1__lastChangedDate__c" : new Date("2025-07-20T19:16:13Z"),
    "CA10A1__lastRotatedDate__c" : new Date("2025-07-21T00:00:00Z"),
    "Id" : "test6"
  } ];
  """;

  CREATE TEMP FUNCTION process_CA10A1__CaAwsSecretsManagerSecret__c(
      obj STRUCT<
          CA10A1__disappearanceTime__c TIMESTAMP,
          CA10A1__deletedDate__c TIMESTAMP,
          CA10A1__lastAccessedDate__c TIMESTAMP,
          CA10A1__lastChangedDate__c TIMESTAMP,
          CA10A1__lastRotatedDate__c TIMESTAMP,
          Id 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 IsEmptyLib = new function () {
      this.simpleIsEmpty = function(arg) {
          return arg == null;
      };
      this.simpleIsNotEmpty = function(arg) {
          return arg != null;
      };
  }();
      var todayMinus90Day = new Date(snapshotTime.toISOString().substr(0,10)+'T00:00:00.000Z').getTime() + (-90 * 86400000);
      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};
      }
      // condition[1], conditionIndex:[100..199]
      function extract3() { if (!this.out) { this.out = obj.CA10A1__deletedDate__c; } return this.out; };
      references1.push('Deleted Date [obj.CA10A1__deletedDate__c]: ' + obj.CA10A1__deletedDate__c);
      if (IsEmptyLib.simpleIsNotEmpty(extract3.call(extract3))) {
          return {status: 'INAPPLICABLE', conditionIndex: 199, conditionText: "extract('CA10A1__deletedDate__c').isNotEmpty()", currentStateMessage: "This secret is not active.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[2], conditionIndex:[200..299]
      function extract6() { if (!this.out) { this.out = obj.CA10A1__lastAccessedDate__c; } return this.out; };
      function extract9() { if (!this.out) { this.out = obj.CA10A1__lastChangedDate__c; } return this.out; };
      references1.push('Last Accessed Date [obj.CA10A1__lastAccessedDate__c]: ' + obj.CA10A1__lastAccessedDate__c);
      references1.push('Last Changed Date [obj.CA10A1__lastChangedDate__c]: ' + obj.CA10A1__lastChangedDate__c);
      if (IsEmptyLib.simpleIsEmpty(extract6.call(extract6)) && (extract9.call(extract9) != null && extract9.call(extract9).getTime() < todayMinus90Day)) {
          return {status: 'INCOMPLIANT', conditionIndex: 299, conditionText: "extract('CA10A1__lastAccessedDate__c').isEmpty() && extract('CA10A1__lastChangedDate__c').beyondLastDays(90)", currentStateMessage: "The Secret has never been accessed and last change occurred more than 90 days ago.", currentStateReferences: references1.join('\n'), remediation: "Determine if this secret is still required by any application. If not, consider deleting it.", runtimeError: null};
      }
      // condition[3], conditionIndex:[300..399]
      function extract13() { if (!this.out) { this.out = obj.CA10A1__lastAccessedDate__c; } return this.out; };
      function extract17() { if (!this.out) { this.out = obj.CA10A1__lastRotatedDate__c; } return this.out; };
      references1.push('Last Rotated Date [obj.CA10A1__lastRotatedDate__c]: ' + obj.CA10A1__lastRotatedDate__c);
      if ((extract13.call(extract13) != null && extract13.call(extract13).getTime() < todayMinus90Day) && IsEmptyLib.simpleIsEmpty(extract17.call(extract17))) {
          return {status: 'INCOMPLIANT', conditionIndex: 399, conditionText: "extract('CA10A1__lastAccessedDate__c').beyondLastDays(90) && extract('CA10A1__lastRotatedDate__c').isEmpty()", currentStateMessage: "The secret was last accessed more than 90 days ago and never rotated.", currentStateReferences: references1.join('\n'), remediation: "Determine if this secret is still required by any application. If not, consider deleting it.", runtimeError: null};
      }
      // condition[4], conditionIndex:[400..499]
      function extract20() { if (!this.out) { this.out = obj.CA10A1__lastAccessedDate__c; } return this.out; };
      function extract24() { if (!this.out) { this.out = obj.CA10A1__lastRotatedDate__c; } return this.out; };
      if ((extract20.call(extract20) != null && extract20.call(extract20).getTime() < todayMinus90Day) && (extract24.call(extract24) != null && extract24.call(extract24).getTime() < todayMinus90Day)) {
          return {status: 'INCOMPLIANT', conditionIndex: 499, conditionText: "extract('CA10A1__lastAccessedDate__c').beyondLastDays(90) && extract('CA10A1__lastRotatedDate__c').beyondLastDays(90)", currentStateMessage: "The secret was last accessed and rotated more than 90 days ago.", currentStateReferences: references1.join('\n'), remediation: "Determine if this secret is still required by any application. If not, consider deleting it.", runtimeError: null};
      }
      return {status: 'COMPLIANT', conditionIndex: 500, conditionText: "otherwise", currentStateMessage: "The secret has been accessed, changed, or rotated within the last 90 days.", 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.CA10A1__disappearanceTime__c AS CA10A1__disappearanceTime__c,
          sObject.CA10A1__deletedDate__c AS CA10A1__deletedDate__c,
          sObject.CA10A1__lastAccessedDate__c AS CA10A1__lastAccessedDate__c,
          sObject.CA10A1__lastChangedDate__c AS CA10A1__lastChangedDate__c,
          sObject.CA10A1__lastRotatedDate__c AS CA10A1__lastRotatedDate__c,
          sObject.Id AS Id,
          process_CA10A1__CaAwsSecretsManagerSecret__c(
              STRUCT(
                  sObject.CA10A1__disappearanceTime__c AS CA10A1__disappearanceTime__c,
                  sObject.CA10A1__deletedDate__c AS CA10A1__deletedDate__c,
                  sObject.CA10A1__lastAccessedDate__c AS CA10A1__lastAccessedDate__c,
                  sObject.CA10A1__lastChangedDate__c AS CA10A1__lastChangedDate__c,
                  sObject.CA10A1__lastRotatedDate__c AS CA10A1__lastRotatedDate__c,
                  sObject.Id AS Id
              ),
              sObject.context.snapshotTime
          ) as result
      FROM UNNEST(mock_CA10A1__CaAwsSecretsManagerSecret__c()) AS sObject
  ) sObject ON sObject.Id = expectedResult.Id;
