--- policy: /ce/ca/aws/ec2/launch-template-imdsv2 logic: /ce/ca/aws/ec2/launch-template-imdsv2/prod.logic.yaml executionTime: 2026-04-25T12:02:35.796018066Z generationMs: 60 executionMs: 1618 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: UNDETERMINED actual: UNDETERMINED conditionIndex: expected: 199 actual: 199 conditionText: expected: isEmptyLookup('CA10A1__latestVersion__r') actual: isEmptyLookup('CA10A1__latestVersion__r') runtimeError: {} - id: test3 match: true status: expected: UNDETERMINED actual: UNDETERMINED conditionIndex: expected: 199 actual: 199 conditionText: expected: isEmptyLookup('CA10A1__latestVersion__r') actual: isEmptyLookup('CA10A1__latestVersion__r') runtimeError: {} - id: test4 match: true status: expected: INCOMPLIANT actual: INCOMPLIANT conditionIndex: expected: 299 actual: 299 conditionText: expected: extract('CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c') == 'disabled' actual: extract('CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c') == 'disabled' runtimeError: {} - id: test5 match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 399 actual: 399 conditionText: expected: extract('CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c') == 'required' actual: extract('CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c') == 'required' runtimeError: {} - id: test6 match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 399 actual: 399 conditionText: expected: extract('CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c') == 'required' actual: extract('CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c') == 'required' runtimeError: {} - id: test7 match: true status: expected: INCOMPLIANT actual: INCOMPLIANT conditionIndex: expected: 400 actual: 400 conditionText: expected: otherwise actual: otherwise runtimeError: {} - id: test8 match: true status: expected: INCOMPLIANT actual: INCOMPLIANT conditionIndex: expected: 400 actual: 400 conditionText: expected: otherwise actual: otherwise runtimeError: {} usedFiles: - path: /ce/ca/aws/ec2/launch-template-imdsv2/policy.yaml md5Hash: 05B796343E2D1F15435B451FBD0CDD99 content: | --- names: full: AWS EC2 Launch Template Latest Version is not configured to require IMDSv2 contextual: EC2 Launch Template Latest Version is not configured to require IMDSv2 description: > Ensure that the latest version of each Amazon EC2 launch template explicitly requires Instance Metadata Service Version 2 (IMDSv2). type: COMPLIANCE_POLICY categories: - SECURITY frameworkMappings: - "/frameworks/cloudaware/resource-security/secure-access" - "/frameworks/aws-fsbp-v1.0.0/ec2/170" similarPolicies: awsSecurityHub: - name: "[EC2.170] EC2 launch templates should use Instance Metadata Service Version 2 (IMDSv2)" url: "https://docs.aws.amazon.com/securityhub/latest/userguide/ec2-controls.html#ec2-170" - path: /ce/ca/aws/ec2/launch-template-imdsv2/prod.logic.yaml md5Hash: 80F6AB6AA06F10F6B8B899BC6CF0909E content: | --- inputType: "CA10A1__CaAwsEc2LaunchTemplate__c" importExtracts: - file: "/types/CA10A1__CaAwsEc2LaunchTemplateVersion__c/object.extracts.yaml" testData: - file: "test-data.json" conditions: - status: "UNDETERMINED" currentStateMessage: "The latest launch template version is not present in the CMDB." check: IS_EMPTY_LOOKUP: "CA10A1__latestVersion__r" - status: "INCOMPLIANT" currentStateMessage: "The latest launch template version disables the instance metadata service HTTP endpoint." remediationMessage: "Publish a new launch template version with the instance metadata service HTTP endpoint enabled and IMDSv2 required." check: IS_EQUAL: left: EXTRACT: "CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c" right: TEXT: "disabled" - status: "COMPLIANT" currentStateMessage: "The latest launch template version requires IMDSv2." check: IS_EQUAL: left: EXTRACT: "CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c" right: TEXT: "required" otherwise: status: "INCOMPLIANT" currentStateMessage: "The latest launch template version does not require IMDSv2." remediationMessage: "Publish a new launch template version that requires IMDSv2." - path: /ce/ca/aws/ec2/launch-template-imdsv2/test-data.json md5Hash: 80DC2BD5E9124CE9AA2CFA58FC7C5100 content: | [ { "expectedResult": { "status": "DISAPPEARED", "conditionIndex": "99", "conditionText": "isDisappeared(CA10A1__disappearanceTime__c)", "runtimeError": null }, "context": { "snapshotTime": "2026-04-16T12:00:00Z" }, "Id": "test1", "CA10A1__disappearanceTime__c": "2026-04-15T12:00:00Z", "CA10A1__latestVersion__c": "latestVersion1", "CA10A1__latestVersionUniqueId__c": "lt-00000000000000001:1", "CA10A1__latestVersion__r": { "Id": "latestVersion1", "CA10A1__disappearanceTime__c": null, "CA10A1__metadataHttpEndpoint__c": "enabled", "CA10A1__metadataHttpTokens__c": "required" } }, { "expectedResult": { "status": "UNDETERMINED", "conditionIndex": "199", "conditionText": "isEmptyLookup('CA10A1__latestVersion__r')", "runtimeError": null }, "context": { "snapshotTime": "2026-04-16T12:00:00Z" }, "Id": "test2", "CA10A1__disappearanceTime__c": null, "CA10A1__latestVersion__c": null, "CA10A1__latestVersionUniqueId__c": null, "CA10A1__latestVersion__r": { "Id": null, "CA10A1__disappearanceTime__c": null, "CA10A1__metadataHttpEndpoint__c": null, "CA10A1__metadataHttpTokens__c": null } }, { "expectedResult": { "status": "UNDETERMINED", "conditionIndex": "199", "conditionText": "isEmptyLookup('CA10A1__latestVersion__r')", "runtimeError": null }, "context": { "snapshotTime": "2026-04-16T12:00:00Z" }, "Id": "test3", "CA10A1__disappearanceTime__c": null, "CA10A1__latestVersion__c": "latestVersion3", "CA10A1__latestVersionUniqueId__c": "lt-00000000000000003:3", "CA10A1__latestVersion__r": { "Id": "latestVersion3", "CA10A1__disappearanceTime__c": "2026-04-15T12:00:00Z", "CA10A1__metadataHttpEndpoint__c": "", "CA10A1__metadataHttpTokens__c": "" } }, { "expectedResult": { "status": "INCOMPLIANT", "conditionIndex": "299", "conditionText": "extract('CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c') == 'disabled'", "runtimeError": null }, "context": { "snapshotTime": "2026-04-16T12:00:00Z" }, "Id": "test4", "CA10A1__disappearanceTime__c": null, "CA10A1__latestVersion__c": "latestVersion4", "CA10A1__latestVersionUniqueId__c": "lt-00000000000000004:4", "CA10A1__latestVersion__r": { "Id": "latestVersion4", "CA10A1__disappearanceTime__c": null, "CA10A1__metadataHttpEndpoint__c": "disabled", "CA10A1__metadataHttpTokens__c": "" } }, { "expectedResult": { "status": "COMPLIANT", "conditionIndex": "399", "conditionText": "extract('CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c') == 'required'", "runtimeError": null }, "context": { "snapshotTime": "2026-04-16T12:00:00Z" }, "Id": "test5", "CA10A1__disappearanceTime__c": null, "CA10A1__latestVersion__c": "latestVersion5", "CA10A1__latestVersionUniqueId__c": "lt-00000000000000005:5", "CA10A1__latestVersion__r": { "Id": "latestVersion5", "CA10A1__disappearanceTime__c": null, "CA10A1__metadataHttpEndpoint__c": "enabled", "CA10A1__metadataHttpTokens__c": "required" } }, { "expectedResult": { "status": "COMPLIANT", "conditionIndex": "399", "conditionText": "extract('CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c') == 'required'", "runtimeError": null }, "context": { "snapshotTime": "2026-04-16T12:00:00Z" }, "Id": "test6", "CA10A1__disappearanceTime__c": null, "CA10A1__latestVersion__c": "latestVersion6", "CA10A1__latestVersionUniqueId__c": "lt-00000000000000006:6", "CA10A1__latestVersion__r": { "Id": "latestVersion6", "CA10A1__disappearanceTime__c": null, "CA10A1__metadataHttpEndpoint__c": "", "CA10A1__metadataHttpTokens__c": "required" } }, { "expectedResult": { "status": "INCOMPLIANT", "conditionIndex": "400", "conditionText": "otherwise", "runtimeError": null }, "context": { "snapshotTime": "2026-04-16T12:00:00Z" }, "Id": "test7", "CA10A1__disappearanceTime__c": null, "CA10A1__latestVersion__c": "latestVersion7", "CA10A1__latestVersionUniqueId__c": "lt-00000000000000007:7", "CA10A1__latestVersion__r": { "Id": "latestVersion7", "CA10A1__disappearanceTime__c": null, "CA10A1__metadataHttpEndpoint__c": "enabled", "CA10A1__metadataHttpTokens__c": "optional" } }, { "expectedResult": { "status": "INCOMPLIANT", "conditionIndex": "400", "conditionText": "otherwise", "runtimeError": null }, "context": { "snapshotTime": "2026-04-16T12:00:00Z" }, "Id": "test8", "CA10A1__disappearanceTime__c": null, "CA10A1__latestVersion__c": "latestVersion8", "CA10A1__latestVersionUniqueId__c": "lt-00000000000000008:8", "CA10A1__latestVersion__r": { "Id": "latestVersion8", "CA10A1__disappearanceTime__c": null, "CA10A1__metadataHttpEndpoint__c": "", "CA10A1__metadataHttpTokens__c": "" } } ] - path: /types/CA10A1__CaAwsEc2LaunchTemplateVersion__c/object.extracts.yaml md5Hash: 0CF0050EB6BA851041A4284E9AEA6611 content: "---\nextracts:\n# Values: Enabled | Disabled. Nullable. NULL value ==\ \ Enabled\n# Can't have no access, retrieved via ec2:DescribeLaunchTemplateVersions\n\ \ - name: CA10A1__metadataHttpEndpoint__c\n value: \n FIELD:\n \ \ path: CA10A1__metadataHttpEndpoint__c\n# Values: Required | Optional. Nullable.\ \ NULL value == Optional\n# Can't have no access, retrieved via ec2:DescribeLaunchTemplateVersions\ \ \n - name: CA10A1__metadataHttpTokens__c\n value: \n FIELD:\n \ \ path: CA10A1__metadataHttpTokens__c" script: |- CREATE TEMP FUNCTION mock_ExpectedResult() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "Id" : "test1", "expectedResult" : { "status" : "DISAPPEARED", "conditionIndex" : "99", "conditionText" : "isDisappeared(CA10A1__disappearanceTime__c)", "runtimeError" : null } }, { "Id" : "test2", "expectedResult" : { "status" : "UNDETERMINED", "conditionIndex" : "199", "conditionText" : "isEmptyLookup('CA10A1__latestVersion__r')", "runtimeError" : null } }, { "Id" : "test3", "expectedResult" : { "status" : "UNDETERMINED", "conditionIndex" : "199", "conditionText" : "isEmptyLookup('CA10A1__latestVersion__r')", "runtimeError" : null } }, { "Id" : "test4", "expectedResult" : { "status" : "INCOMPLIANT", "conditionIndex" : "299", "conditionText" : "extract('CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c') == 'disabled'", "runtimeError" : null } }, { "Id" : "test5", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : "399", "conditionText" : "extract('CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c') == 'required'", "runtimeError" : null } }, { "Id" : "test6", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : "399", "conditionText" : "extract('CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c') == 'required'", "runtimeError" : null } }, { "Id" : "test7", "expectedResult" : { "status" : "INCOMPLIANT", "conditionIndex" : "400", "conditionText" : "otherwise", "runtimeError" : null } }, { "Id" : "test8", "expectedResult" : { "status" : "INCOMPLIANT", "conditionIndex" : "400", "conditionText" : "otherwise", "runtimeError" : null } } ]; """; CREATE TEMP FUNCTION mock_CA10A1__CaAwsEc2LaunchTemplate__c() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "context" : { "snapshotTime" : new Date("2026-04-16T12:00:00Z") }, "CA10A1__disappearanceTime__c" : new Date("2026-04-15T12:00:00Z"), "CA10A1__latestVersion__c" : "latestVersion1", "CA10A1__latestVersionUniqueId__c" : "lt-00000000000000001:1", "Id" : "test1" }, { "context" : { "snapshotTime" : new Date("2026-04-16T12:00:00Z") }, "CA10A1__latestVersion__c" : null, "CA10A1__latestVersionUniqueId__c" : null, "Id" : "test2" }, { "context" : { "snapshotTime" : new Date("2026-04-16T12:00:00Z") }, "CA10A1__latestVersion__c" : "latestVersion3", "CA10A1__latestVersionUniqueId__c" : "lt-00000000000000003:3", "Id" : "test3" }, { "context" : { "snapshotTime" : new Date("2026-04-16T12:00:00Z") }, "CA10A1__latestVersion__c" : "latestVersion4", "CA10A1__latestVersionUniqueId__c" : "lt-00000000000000004:4", "Id" : "test4" }, { "context" : { "snapshotTime" : new Date("2026-04-16T12:00:00Z") }, "CA10A1__latestVersion__c" : "latestVersion5", "CA10A1__latestVersionUniqueId__c" : "lt-00000000000000005:5", "Id" : "test5" }, { "context" : { "snapshotTime" : new Date("2026-04-16T12:00:00Z") }, "CA10A1__latestVersion__c" : "latestVersion6", "CA10A1__latestVersionUniqueId__c" : "lt-00000000000000006:6", "Id" : "test6" }, { "context" : { "snapshotTime" : new Date("2026-04-16T12:00:00Z") }, "CA10A1__latestVersion__c" : "latestVersion7", "CA10A1__latestVersionUniqueId__c" : "lt-00000000000000007:7", "Id" : "test7" }, { "context" : { "snapshotTime" : new Date("2026-04-16T12:00:00Z") }, "CA10A1__latestVersion__c" : "latestVersion8", "CA10A1__latestVersionUniqueId__c" : "lt-00000000000000008:8", "Id" : "test8" } ]; """; CREATE TEMP FUNCTION mock_CA10A1__CaAwsEc2LaunchTemplateVersion__c() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "context" : { "snapshotTime" : new Date("2026-04-16T12:00:00Z") }, "Id" : "latestVersion1", "CA10A1__metadataHttpEndpoint__c" : "enabled", "CA10A1__metadataHttpTokens__c" : "required" }, { "context" : { "snapshotTime" : new Date("2026-04-16T12:00:00Z") }, "Id" : null, "CA10A1__metadataHttpEndpoint__c" : null, "CA10A1__metadataHttpTokens__c" : null }, { "context" : { "snapshotTime" : new Date("2026-04-16T12:00:00Z") }, "Id" : "latestVersion3", "CA10A1__disappearanceTime__c" : new Date("2026-04-15T12:00:00Z"), "CA10A1__metadataHttpEndpoint__c" : "", "CA10A1__metadataHttpTokens__c" : "" }, { "context" : { "snapshotTime" : new Date("2026-04-16T12:00:00Z") }, "Id" : "latestVersion4", "CA10A1__metadataHttpEndpoint__c" : "disabled", "CA10A1__metadataHttpTokens__c" : "" }, { "context" : { "snapshotTime" : new Date("2026-04-16T12:00:00Z") }, "Id" : "latestVersion5", "CA10A1__metadataHttpEndpoint__c" : "enabled", "CA10A1__metadataHttpTokens__c" : "required" }, { "context" : { "snapshotTime" : new Date("2026-04-16T12:00:00Z") }, "Id" : "latestVersion6", "CA10A1__metadataHttpEndpoint__c" : "", "CA10A1__metadataHttpTokens__c" : "required" }, { "context" : { "snapshotTime" : new Date("2026-04-16T12:00:00Z") }, "Id" : "latestVersion7", "CA10A1__metadataHttpEndpoint__c" : "enabled", "CA10A1__metadataHttpTokens__c" : "optional" }, { "context" : { "snapshotTime" : new Date("2026-04-16T12:00:00Z") }, "Id" : "latestVersion8", "CA10A1__metadataHttpEndpoint__c" : "", "CA10A1__metadataHttpTokens__c" : "" } ]; """; CREATE TEMP FUNCTION process_CA10A1__CaAwsEc2LaunchTemplate__c( obj STRUCT< CA10A1__disappearanceTime__c TIMESTAMP, CA10A1__latestVersion__c STRING, CA10A1__latestVersionUniqueId__c STRING, Id STRING, CA10A1__latestVersion__r STRUCT< Id STRING, CA10A1__disappearanceTime__c TIMESTAMP, CA10A1__metadataHttpEndpoint__c STRING, CA10A1__metadataHttpTokens__c STRING > >, snapshotTime TIMESTAMP ) RETURNS STRUCT 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)); }; this.containsAll = function(arg, substrings) { if (substrings == null || substrings.length === 0) return false; let normalizedArg = this.normalize(arg); return substrings.every(sub => normalizedArg.includes(this.normalize(sub))); }; this.containsAny = function(arg, substrings) { if (substrings == null || substrings.length === 0) return false; let normalizedArg = this.normalize(arg); return substrings.some(sub => normalizedArg.includes(this.normalize(sub))); }; }(); 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] if (TextLib.isEmpty(obj.CA10A1__latestVersionUniqueId__c) || TextLib.isEmpty(obj.CA10A1__latestVersion__c) || obj.CA10A1__latestVersion__r.CA10A1__disappearanceTime__c != null) { return {status: 'UNDETERMINED', conditionIndex: 199, conditionText: "isEmptyLookup('CA10A1__latestVersion__r')", currentStateMessage: "The latest launch template version is not present in the CMDB.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } // condition[2], conditionIndex:[200..299] function extractChecked2() { if (TextLib.isEmpty(obj.CA10A1__latestVersionUniqueId__c)) { throw new Error("UNDETERMINED condition:201", {cause: {status: 'UNDETERMINED', conditionIndex: 201, conditionText: "extractCheck(obj.CA10A1__latestVersionUniqueId__c)", currentStateMessage: "Related object via CA10A1__latestVersionUniqueId__c has empty ID", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } if (TextLib.isEmpty(obj.CA10A1__latestVersion__c)) { throw new Error("UNDETERMINED condition:202", {cause: {status: 'UNDETERMINED', conditionIndex: 202, conditionText: "extractCheck(obj.CA10A1__latestVersion__c)", currentStateMessage: "Related object via CA10A1__latestVersion__c is not present", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } if (obj.CA10A1__latestVersion__r.CA10A1__disappearanceTime__c != null) { throw new Error("UNDETERMINED condition:203", {cause: {status: 'UNDETERMINED', conditionIndex: 203, conditionText: "extractCheck(obj.CA10A1__latestVersion__r.CA10A1__disappearanceTime__c)", currentStateMessage: "Related object via CA10A1__latestVersion__c is present, but deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } return extract3.call(extract3); } function extract3() { if (!this.out) { this.out = obj.CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c; } return this.out; }; references1.push('Metadata HTTP Endpoint [obj.CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c]: ' + obj.CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c); try { if (TextLib.equal(extractChecked2(), 'disabled')) { return {status: 'INCOMPLIANT', conditionIndex: 299, conditionText: "extract('CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c') == 'disabled'", currentStateMessage: "The latest launch template version disables the instance metadata service HTTP endpoint.", currentStateReferences: references1.join('\n'), remediation: "Publish a new launch template version with the instance metadata service HTTP endpoint enabled and IMDSv2 required.", runtimeError: null}; } } catch (err) { if (err.cause && err.cause.status) { return err.cause; } else { throw err; } } // condition[3], conditionIndex:[300..399] function extractChecked5() { if (TextLib.isEmpty(obj.CA10A1__latestVersionUniqueId__c)) { throw new Error("UNDETERMINED condition:301", {cause: {status: 'UNDETERMINED', conditionIndex: 301, conditionText: "extractCheck(obj.CA10A1__latestVersionUniqueId__c)", currentStateMessage: "Related object via CA10A1__latestVersionUniqueId__c has empty ID", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } if (TextLib.isEmpty(obj.CA10A1__latestVersion__c)) { throw new Error("UNDETERMINED condition:302", {cause: {status: 'UNDETERMINED', conditionIndex: 302, conditionText: "extractCheck(obj.CA10A1__latestVersion__c)", currentStateMessage: "Related object via CA10A1__latestVersion__c is not present", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } if (obj.CA10A1__latestVersion__r.CA10A1__disappearanceTime__c != null) { throw new Error("UNDETERMINED condition:303", {cause: {status: 'UNDETERMINED', conditionIndex: 303, conditionText: "extractCheck(obj.CA10A1__latestVersion__r.CA10A1__disappearanceTime__c)", currentStateMessage: "Related object via CA10A1__latestVersion__c is present, but deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } return extract6.call(extract6); } function extract6() { if (!this.out) { this.out = obj.CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c; } return this.out; }; references1.push('Metadata HTTP Tokens [obj.CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c]: ' + obj.CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c); try { if (TextLib.equal(extractChecked5(), 'required')) { return {status: 'COMPLIANT', conditionIndex: 399, conditionText: "extract('CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c') == 'required'", currentStateMessage: "The latest launch template version requires IMDSv2.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } } catch (err) { if (err.cause && err.cause.status) { return err.cause; } else { throw err; } } return {status: 'INCOMPLIANT', conditionIndex: 400, conditionText: "otherwise", currentStateMessage: "The latest launch template version does not require IMDSv2.", currentStateReferences: references1.join('\n'), remediation: "Publish a new launch template version that requires IMDSv2.", 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__latestVersion__c AS CA10A1__latestVersion__c, sObject.CA10A1__latestVersionUniqueId__c AS CA10A1__latestVersionUniqueId__c, sObject.Id AS Id, STRUCT ( `CA10A1__latestVersion__r`.Id AS Id, `CA10A1__latestVersion__r`.CA10A1__disappearanceTime__c AS CA10A1__disappearanceTime__c, `CA10A1__latestVersion__r`.CA10A1__metadataHttpEndpoint__c AS CA10A1__metadataHttpEndpoint__c, `CA10A1__latestVersion__r`.CA10A1__metadataHttpTokens__c AS CA10A1__metadataHttpTokens__c ) AS CA10A1__latestVersion__r, process_CA10A1__CaAwsEc2LaunchTemplate__c( STRUCT( sObject.CA10A1__disappearanceTime__c AS CA10A1__disappearanceTime__c, sObject.CA10A1__latestVersion__c AS CA10A1__latestVersion__c, sObject.CA10A1__latestVersionUniqueId__c AS CA10A1__latestVersionUniqueId__c, sObject.Id AS Id, STRUCT ( `CA10A1__latestVersion__r`.Id AS Id, `CA10A1__latestVersion__r`.CA10A1__disappearanceTime__c AS CA10A1__disappearanceTime__c, `CA10A1__latestVersion__r`.CA10A1__metadataHttpEndpoint__c AS CA10A1__metadataHttpEndpoint__c, `CA10A1__latestVersion__r`.CA10A1__metadataHttpTokens__c AS CA10A1__metadataHttpTokens__c ) AS CA10A1__latestVersion__r ), sObject.context.snapshotTime ) as result FROM UNNEST(mock_CA10A1__CaAwsEc2LaunchTemplate__c()) AS sObject LEFT JOIN UNNEST(mock_CA10A1__CaAwsEc2LaunchTemplateVersion__c()) AS `CA10A1__latestVersion__r` ON sObject.CA10A1__latestVersion__c = `CA10A1__latestVersion__r`.Id ) sObject ON sObject.Id = expectedResult.Id;