--- policy: /ce/ca/aws/autoscaling/group-launch-template-imdsv2 logic: /ce/ca/aws/autoscaling/group-launch-template-imdsv2/prod.logic.yaml executionTime: 2026-02-10T22:32:33.240055979Z generationMs: 196 executionMs: 935 rows: - id: test1 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: test2 match: true status: expected: INAPPLICABLE actual: INAPPLICABLE conditionIndex: expected: 199 actual: 199 conditionText: expected: extract('CA10__launchConfigurationName__c').isNotEmpty() actual: extract('CA10__launchConfigurationName__c').isNotEmpty() runtimeError: {} - id: test3 match: true status: expected: UNDETERMINED actual: UNDETERMINED conditionIndex: expected: 299 actual: 299 conditionText: expected: extract('CA10A1__launchTemplateId__c').isNotEmpty() && (isEmptyLookup('CA10A1__launchTemplate__r') || isEmptyLookup('CA10A1__launchTemplate__r.CA10A1__latestVersion__r')) actual: extract('CA10A1__launchTemplateId__c').isNotEmpty() && (isEmptyLookup('CA10A1__launchTemplate__r') || isEmptyLookup('CA10A1__launchTemplate__r.CA10A1__latestVersion__r')) runtimeError: {} - id: test4 match: true status: expected: UNDETERMINED actual: UNDETERMINED conditionIndex: expected: 299 actual: 299 conditionText: expected: extract('CA10A1__launchTemplateId__c').isNotEmpty() && (isEmptyLookup('CA10A1__launchTemplate__r') || isEmptyLookup('CA10A1__launchTemplate__r.CA10A1__latestVersion__r')) actual: extract('CA10A1__launchTemplateId__c').isNotEmpty() && (isEmptyLookup('CA10A1__launchTemplate__r') || isEmptyLookup('CA10A1__launchTemplate__r.CA10A1__latestVersion__r')) runtimeError: {} - id: test5 match: true status: expected: UNDETERMINED actual: UNDETERMINED conditionIndex: expected: 399 actual: 399 conditionText: expected: extract('CA10A1__mixedInstancesLaunchTemplateId__c').isNotEmpty() && (isEmptyLookup('CA10A1__mixedInstancesLaunchTemplate__r') || isEmptyLookup('CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r')) actual: extract('CA10A1__mixedInstancesLaunchTemplateId__c').isNotEmpty() && (isEmptyLookup('CA10A1__mixedInstancesLaunchTemplate__r') || isEmptyLookup('CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r')) runtimeError: {} - id: test6 match: true status: expected: UNDETERMINED actual: UNDETERMINED conditionIndex: expected: 399 actual: 399 conditionText: expected: extract('CA10A1__mixedInstancesLaunchTemplateId__c').isNotEmpty() && (isEmptyLookup('CA10A1__mixedInstancesLaunchTemplate__r') || isEmptyLookup('CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r')) actual: extract('CA10A1__mixedInstancesLaunchTemplateId__c').isNotEmpty() && (isEmptyLookup('CA10A1__mixedInstancesLaunchTemplate__r') || isEmptyLookup('CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r')) runtimeError: {} - id: test7 match: true status: expected: INCOMPLIANT actual: INCOMPLIANT conditionIndex: expected: 499 actual: 499 conditionText: expected: extract('CA10A1__launchTemplateId__c').isNotEmpty() && extract('CA10A1__launchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c') == 'disabled' actual: extract('CA10A1__launchTemplateId__c').isNotEmpty() && extract('CA10A1__launchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c') == 'disabled' runtimeError: {} - id: test8 match: true status: expected: INCOMPLIANT actual: INCOMPLIANT conditionIndex: expected: 599 actual: 599 conditionText: expected: extract('CA10A1__mixedInstancesLaunchTemplateId__c').isNotEmpty() && extract('CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c') == 'disabled' actual: extract('CA10A1__mixedInstancesLaunchTemplateId__c').isNotEmpty() && extract('CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c') == 'disabled' runtimeError: {} - id: test9 match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 699 actual: 699 conditionText: expected: extract('CA10A1__launchTemplateId__c').isNotEmpty() && extract('CA10A1__launchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c') == 'required' actual: extract('CA10A1__launchTemplateId__c').isNotEmpty() && extract('CA10A1__launchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c') == 'required' runtimeError: {} - id: test10 match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 799 actual: 799 conditionText: expected: extract('CA10A1__mixedInstancesLaunchTemplateId__c').isNotEmpty() && extract('CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c') == 'required' actual: extract('CA10A1__mixedInstancesLaunchTemplateId__c').isNotEmpty() && extract('CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c') == 'required' runtimeError: {} - id: test11 match: true status: expected: INCOMPLIANT actual: INCOMPLIANT conditionIndex: expected: 800 actual: 800 conditionText: expected: otherwise actual: otherwise runtimeError: {} - id: test12 match: true status: expected: INCOMPLIANT actual: INCOMPLIANT conditionIndex: expected: 800 actual: 800 conditionText: expected: otherwise actual: otherwise runtimeError: {} usedFiles: - path: /ce/ca/aws/autoscaling/group-launch-template-imdsv2/policy.yaml md5Hash: 2BA738690B9315E9C7CB7C6FC7A0EDC5 content: "---\nnames:\n full: AWS EC2 Auto Scaling Group Launch Template is not\ \ configured to require IMDSv2\n contextual: Auto Scaling Group Launch Template\ \ is not configured to require IMDSv2\ndescription: >\n Ensure that the EC2\ \ Auto Scaling Group uses a Launch Template which is configured \n to require\ \ IMDSv2 (Instance Metadata Service Version 2). IMDSv2 is a session-oriented\ \ \n method for accessing instance metadata.\ncategories:\n - \"SECURITY\"\ \ntype: \"COMPLIANCE_POLICY\"\nframeworkMappings:\n - \"/frameworks/cloudaware/resource-security/secure-access\"\ \n - \"/frameworks/aws-fsbp-v1.0.0/auto-scaling/03\"\nsimilarPolicies:\n awsSecurityHub:\n\ \ - name: \"[AutoScaling.3] Auto Scaling group launch configurations should\ \ configure EC2 instances to require Instance Metadata Service Version 2 (IMDSv2)\"\ \n url: \"https://docs.aws.amazon.com/securityhub/latest/userguide/autoscaling-controls.html#autoscaling-3\"\ \n internal:\n - \"dec-x-fe8fe2c6\"" - path: /ce/ca/aws/autoscaling/group-launch-template-imdsv2/prod.logic.yaml md5Hash: AFB5538DDF7C893F449003320F21C6DD content: "---\ninputType: \"CA10__CaAwsAutoScalingGroup__c\"\nimportExtracts:\n\ \ - file: \"/types/CA10A1__CaAwsEc2LaunchTemplateVersion__c/object.extracts.yaml\"\ \n - file: \"/types/CA10__CaAwsAutoScalingGroup__c/object.extracts.yaml\"\n\ testData:\n - file: \"test-data.json\" \nconditions:\n - status: \"INAPPLICABLE\"\ \n currentStateMessage: \"The Auto Scaling group uses a launch configuration.\"\ \n remediationMessage: \"Migrate the Auto Scaling group to a launch template.\"\ \n check:\n NOT_EMPTY:\n arg:\n EXTRACT: \"CA10__launchConfigurationName__c\"\ \n - status: \"UNDETERMINED\"\n currentStateMessage: \"The launch template\ \ is not present in the CMDB.\"\n check:\n AND:\n args:\n \ \ - NOT_EMPTY:\n arg:\n EXTRACT: \"CA10A1__launchTemplateId__c\"\ \n - OR:\n args:\n - IS_EMPTY_LOOKUP: \"\ CA10A1__launchTemplate__r\"\n - IS_EMPTY_LOOKUP: \"CA10A1__launchTemplate__r.CA10A1__latestVersion__r\"\ \n - status: \"UNDETERMINED\"\n currentStateMessage: \"The launch template\ \ is not present in the CMDB.\"\n check:\n AND:\n args:\n \ \ - NOT_EMPTY:\n arg:\n EXTRACT: \"CA10A1__mixedInstancesLaunchTemplateId__c\"\ \n - OR:\n args:\n - IS_EMPTY_LOOKUP: \"\ CA10A1__mixedInstancesLaunchTemplate__r\"\n - IS_EMPTY_LOOKUP:\ \ \"CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r\"\n -\ \ status: \"INCOMPLIANT\"\n currentStateMessage: \"Access to the HTTP endpoint\ \ of the instance metadata service is disabled.\"\n remediationMessage: \"\ Enable access to the instance metadata service.\"\n check:\n AND:\n\ \ args:\n - NOT_EMPTY:\n arg:\n \ \ EXTRACT: \"CA10A1__launchTemplateId__c\"\n - IS_EQUAL:\n \ \ left:\n EXTRACT: \"CA10A1__launchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c\"\ \n right:\n TEXT: \"disabled\"\n - status: \"INCOMPLIANT\"\ \n currentStateMessage: \"Access to the HTTP endpoint of the instance metadata\ \ service is disabled.\"\n remediationMessage: \"Enable access to the instance\ \ metadata service.\"\n check:\n AND:\n args:\n - NOT_EMPTY:\n\ \ arg:\n EXTRACT: \"CA10A1__mixedInstancesLaunchTemplateId__c\"\ \n - IS_EQUAL:\n left:\n EXTRACT: \"CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c\"\ \n right:\n TEXT: \"disabled\"\n - status: \"COMPLIANT\"\ \n currentStateMessage: \"The launch template settings require IMDSv2.\"\n\ \ check:\n AND:\n args:\n - NOT_EMPTY:\n \ \ arg:\n EXTRACT: \"CA10A1__launchTemplateId__c\"\n \ \ - IS_EQUAL:\n left:\n EXTRACT: \"CA10A1__launchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c\"\ \n right:\n TEXT: \"required\"\n - status: \"COMPLIANT\"\ \n currentStateMessage: \"The launch template settings require IMDSv2.\"\n\ \ check:\n AND:\n args:\n - NOT_EMPTY:\n \ \ arg:\n EXTRACT: \"CA10A1__mixedInstancesLaunchTemplateId__c\"\ \n - IS_EQUAL:\n left:\n EXTRACT: \"CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c\"\ \n right:\n TEXT: \"required\"\notherwise:\n status:\ \ \"INCOMPLIANT\"\n currentStateMessage: \"IMDSv2 is not required when requesting\ \ instance metadata.\"\n remediationMessage: \"Configure the template to require\ \ IMDSv2.\"\n" - path: /ce/ca/aws/autoscaling/group-launch-template-imdsv2/test-data.json md5Hash: 30BAABD8C965221D8C82CE87D97F01E4 content: |- [ { "expectedResult": { "status": "DISAPPEARED", "conditionIndex": "99", "conditionText": "isDisappeared(CA10__disappearanceTime__c)", "runtimeError": null }, "context": { "snapshotTime": "2025-06-22T18:49:05Z" }, "Id": "test1", "CA10__disappearanceTime__c": "2025-06-17T15:05:27Z", "CA10__launchConfigurationName__c": "", "CA10A1__launchTemplateId__c": "launchTemplateId1", "CA10A1__launchTemplate__c": "launchTemplate1", "CA10A1__mixedInstancesLaunchTemplateId__c": "", "CA10A1__mixedInstancesLaunchTemplate__c": "", "CA10A1__launchTemplate__r": { "Id": "launchTemplate1", "CA10A1__disappearanceTime__c": "2025-06-17T17:40:24Z", "CA10A1__latestVersion__c": "latestVersion1", "CA10A1__latestVersionUniqueId__c": "launchTemplateId1", "CA10A1__latestVersion__r": { "Id": "latestVersion1", "CA10A1__disappearanceTime__c": "2025-06-17T17:41:14Z", "CA10A1__metadataHttpEndpoint__c": "", "CA10A1__metadataHttpTokens__c": "" } }, "CA10A1__mixedInstancesLaunchTemplate__r": { "Id": null, "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": "INAPPLICABLE", "conditionIndex": "199", "conditionText": "extract('CA10__launchConfigurationName__c').isNotEmpty()", "runtimeError": null }, "context": { "snapshotTime": "2025-06-22T18:49:05Z" }, "Id": "test2", "CA10__disappearanceTime__c": null, "CA10__launchConfigurationName__c": "launchConfigurationName2", "CA10A1__launchTemplateId__c": "", "CA10A1__launchTemplate__c": "", "CA10A1__mixedInstancesLaunchTemplateId__c": "", "CA10A1__mixedInstancesLaunchTemplate__c": "", "CA10A1__launchTemplate__r": { "Id": null, "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 } }, "CA10A1__mixedInstancesLaunchTemplate__r": { "Id": null, "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": "299", "conditionText": "extract('CA10A1__launchTemplateId__c').isNotEmpty() && (isEmptyLookup('CA10A1__launchTemplate__r') || isEmptyLookup('CA10A1__launchTemplate__r.CA10A1__latestVersion__r'))", "runtimeError": null }, "context": { "snapshotTime": "2025-06-22T18:49:05Z" }, "Id": "test3", "CA10__disappearanceTime__c": null, "CA10__launchConfigurationName__c": "", "CA10A1__launchTemplateId__c": "launchTemplateId3", "CA10A1__launchTemplate__c": "launchTemplate3", "CA10A1__mixedInstancesLaunchTemplateId__c": "", "CA10A1__mixedInstancesLaunchTemplate__c": "", "CA10A1__launchTemplate__r": { "Id": "launchTemplate3", "CA10A1__disappearanceTime__c": null, "CA10A1__latestVersion__c": "latestVersion3", "CA10A1__latestVersionUniqueId__c": "launchTemplateId3", "CA10A1__latestVersion__r": { "Id": "latestVersion3", "CA10A1__disappearanceTime__c": "2025-06-17T17:41:14Z", "CA10A1__metadataHttpEndpoint__c": "", "CA10A1__metadataHttpTokens__c": "" } }, "CA10A1__mixedInstancesLaunchTemplate__r": { "Id": null, "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": "299", "conditionText": "extract('CA10A1__launchTemplateId__c').isNotEmpty() && (isEmptyLookup('CA10A1__launchTemplate__r') || isEmptyLookup('CA10A1__launchTemplate__r.CA10A1__latestVersion__r'))", "runtimeError": null }, "context": { "snapshotTime": "2025-06-22T18:49:05Z" }, "Id": "test4", "CA10__disappearanceTime__c": null, "CA10__launchConfigurationName__c": "", "CA10A1__launchTemplateId__c": "launchTemplateId4", "CA10A1__launchTemplate__c": "launchTemplate4", "CA10A1__mixedInstancesLaunchTemplateId__c": "", "CA10A1__mixedInstancesLaunchTemplate__c": "", "CA10A1__launchTemplate__r": { "Id": "launchTemplate4", "CA10A1__disappearanceTime__c": "2025-06-17T17:41:14Z", "CA10A1__latestVersion__c": "latestVersion4", "CA10A1__latestVersionUniqueId__c": "launchTemplateId4", "CA10A1__latestVersion__r": { "Id": "latestVersion4", "CA10A1__disappearanceTime__c": "2025-06-17T17:41:14Z", "CA10A1__metadataHttpEndpoint__c": "", "CA10A1__metadataHttpTokens__c": "" } }, "CA10A1__mixedInstancesLaunchTemplate__r": { "Id": null, "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": "399", "conditionText": "extract('CA10A1__mixedInstancesLaunchTemplateId__c').isNotEmpty() && (isEmptyLookup('CA10A1__mixedInstancesLaunchTemplate__r') || isEmptyLookup('CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r'))", "runtimeError": null }, "context": { "snapshotTime": "2025-06-22T18:49:05Z" }, "Id": "test5", "CA10__disappearanceTime__c": null, "CA10__launchConfigurationName__c": "", "CA10A1__launchTemplateId__c": "", "CA10A1__launchTemplate__c": "", "CA10A1__mixedInstancesLaunchTemplateId__c": "mixedInstancesLaunchTemplateId5", "CA10A1__mixedInstancesLaunchTemplate__c": "mixedInstancesLaunchTemplate5", "CA10A1__launchTemplate__r": { "Id": null, "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 } }, "CA10A1__mixedInstancesLaunchTemplate__r": { "Id": "mixedInstancesLaunchTemplate5", "CA10A1__disappearanceTime__c": null, "CA10A1__latestVersion__c": "latestVersion5", "CA10A1__latestVersionUniqueId__c": "latestVersionUniqueId5", "CA10A1__latestVersion__r": { "Id": "latestVersion5", "CA10A1__disappearanceTime__c": "2025-06-22T18:49:05Z", "CA10A1__metadataHttpEndpoint__c": "", "CA10A1__metadataHttpTokens__c": "" } } }, { "expectedResult": { "status": "UNDETERMINED", "conditionIndex": "399", "conditionText": "extract('CA10A1__mixedInstancesLaunchTemplateId__c').isNotEmpty() && (isEmptyLookup('CA10A1__mixedInstancesLaunchTemplate__r') || isEmptyLookup('CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r'))", "runtimeError": null }, "context": { "snapshotTime": "2025-06-22T18:49:05Z" }, "Id": "test6", "CA10__disappearanceTime__c": null, "CA10__launchConfigurationName__c": "", "CA10A1__launchTemplateId__c": "", "CA10A1__launchTemplate__c": "", "CA10A1__mixedInstancesLaunchTemplateId__c": "mixedInstancesLaunchTemplateId6", "CA10A1__mixedInstancesLaunchTemplate__c": "mixedInstancesLaunchTemplate6", "CA10A1__launchTemplate__r": { "Id": null, "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 } }, "CA10A1__mixedInstancesLaunchTemplate__r": { "Id": "mixedInstancesLaunchTemplate6", "CA10A1__disappearanceTime__c": "2025-06-22T18:49:05Z", "CA10A1__latestVersion__c": "latestVersion6", "CA10A1__latestVersionUniqueId__c": "latestVersionUniqueId6", "CA10A1__latestVersion__r": { "Id": "latestVersion6", "CA10A1__disappearanceTime__c": "2025-06-22T18:49:05Z", "CA10A1__metadataHttpEndpoint__c": "", "CA10A1__metadataHttpTokens__c": "" } } }, { "expectedResult": { "status": "INCOMPLIANT", "conditionIndex": "499", "conditionText": "extract('CA10A1__launchTemplateId__c').isNotEmpty() && extract('CA10A1__launchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c') == 'disabled'", "runtimeError": null }, "context": { "snapshotTime": "2025-06-22T18:49:05Z" }, "Id": "test7", "CA10__disappearanceTime__c": null, "CA10__launchConfigurationName__c": "", "CA10A1__launchTemplateId__c": "launchTemplateId7", "CA10A1__launchTemplate__c": "launchTemplate7", "CA10A1__mixedInstancesLaunchTemplateId__c": "", "CA10A1__mixedInstancesLaunchTemplate__c": "", "CA10A1__launchTemplate__r": { "Id": "launchTemplate7", "CA10A1__disappearanceTime__c": null, "CA10A1__latestVersion__c": "latestVersion7", "CA10A1__latestVersionUniqueId__c": "launchTemplateId7", "CA10A1__latestVersion__r": { "Id": "latestVersion7", "CA10A1__disappearanceTime__c": null, "CA10A1__metadataHttpEndpoint__c": "disabled", "CA10A1__metadataHttpTokens__c": "" } }, "CA10A1__mixedInstancesLaunchTemplate__r": { "Id": null, "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": "INCOMPLIANT", "conditionIndex": "599", "conditionText": "extract('CA10A1__mixedInstancesLaunchTemplateId__c').isNotEmpty() && extract('CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c') == 'disabled'", "runtimeError": null }, "context": { "snapshotTime": "2025-06-22T18:49:05Z" }, "Id": "test8", "CA10__disappearanceTime__c": null, "CA10__launchConfigurationName__c": "", "CA10A1__launchTemplateId__c": "", "CA10A1__launchTemplate__c": "", "CA10A1__mixedInstancesLaunchTemplateId__c": "mixedInstancesLaunchTemplateId8", "CA10A1__mixedInstancesLaunchTemplate__c": "mixedInstancesLaunchTemplate8", "CA10A1__launchTemplate__r": { "Id": null, "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 } }, "CA10A1__mixedInstancesLaunchTemplate__r": { "Id": "mixedInstancesLaunchTemplate8", "CA10A1__disappearanceTime__c": null, "CA10A1__latestVersion__c": "latestVersion8", "CA10A1__latestVersionUniqueId__c": "latestVersionUniqueId8", "CA10A1__latestVersion__r": { "Id": "latestVersion8", "CA10A1__disappearanceTime__c": null, "CA10A1__metadataHttpEndpoint__c": "disabled", "CA10A1__metadataHttpTokens__c": "" } } }, { "expectedResult": { "status": "COMPLIANT", "conditionIndex": "699", "conditionText": "extract('CA10A1__launchTemplateId__c').isNotEmpty() && extract('CA10A1__launchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c') == 'required'", "runtimeError": null }, "context": { "snapshotTime": "2025-06-22T18:49:05Z" }, "Id": "test9", "CA10__disappearanceTime__c": null, "CA10__launchConfigurationName__c": "", "CA10A1__launchTemplateId__c": "launchTemplateId9", "CA10A1__launchTemplate__c": "launchTemplate9", "CA10A1__mixedInstancesLaunchTemplateId__c": "", "CA10A1__mixedInstancesLaunchTemplate__c": "", "CA10A1__launchTemplate__r": { "Id": "launchTemplate9", "CA10A1__disappearanceTime__c": null, "CA10A1__latestVersion__c": "latestVersion9", "CA10A1__latestVersionUniqueId__c": "launchTemplateId9", "CA10A1__latestVersion__r": { "Id": "latestVersion9", "CA10A1__disappearanceTime__c": null, "CA10A1__metadataHttpEndpoint__c": "enabled", "CA10A1__metadataHttpTokens__c": "required" } }, "CA10A1__mixedInstancesLaunchTemplate__r": { "Id": null, "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": "COMPLIANT", "conditionIndex": "799", "conditionText": "extract('CA10A1__mixedInstancesLaunchTemplateId__c').isNotEmpty() && extract('CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c') == 'required'", "runtimeError": null }, "context": { "snapshotTime": "2025-06-22T18:49:05Z" }, "Id": "test10", "CA10__disappearanceTime__c": null, "CA10__launchConfigurationName__c": "", "CA10A1__launchTemplateId__c": "", "CA10A1__launchTemplate__c": "", "CA10A1__mixedInstancesLaunchTemplateId__c": "mixedInstancesLaunchTemplateId10", "CA10A1__mixedInstancesLaunchTemplate__c": "mixedInstancesLaunchTemplate10", "CA10A1__launchTemplate__r": { "Id": null, "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 } }, "CA10A1__mixedInstancesLaunchTemplate__r": { "Id": "mixedInstancesLaunchTemplate10", "CA10A1__disappearanceTime__c": null, "CA10A1__latestVersion__c": "latestVersion10", "CA10A1__latestVersionUniqueId__c": "latestVersionUniqueId10", "CA10A1__latestVersion__r": { "Id": "latestVersion10", "CA10A1__disappearanceTime__c": null, "CA10A1__metadataHttpEndpoint__c": "", "CA10A1__metadataHttpTokens__c": "required" } } }, { "expectedResult": { "status": "INCOMPLIANT", "conditionIndex": "800", "conditionText": "otherwise", "runtimeError": null }, "context": { "snapshotTime": "2025-06-22T18:49:05Z" }, "Id": "test11", "CA10__disappearanceTime__c": null, "CA10__launchConfigurationName__c": "", "CA10A1__launchTemplateId__c": "launchTemplateId11", "CA10A1__launchTemplate__c": "launchTemplate11", "CA10A1__mixedInstancesLaunchTemplateId__c": "", "CA10A1__mixedInstancesLaunchTemplate__c": "", "CA10A1__launchTemplate__r": { "Id": "launchTemplate11", "CA10A1__disappearanceTime__c": null, "CA10A1__latestVersion__c": "latestVersion11", "CA10A1__latestVersionUniqueId__c": "launchTemplateId11", "CA10A1__latestVersion__r": { "Id": "latestVersion11", "CA10A1__disappearanceTime__c": null, "CA10A1__metadataHttpEndpoint__c": "enabled", "CA10A1__metadataHttpTokens__c": "optional" } }, "CA10A1__mixedInstancesLaunchTemplate__r": { "Id": null, "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": "INCOMPLIANT", "conditionIndex": "800", "conditionText": "otherwise", "runtimeError": null }, "context": { "snapshotTime": "2025-06-22T18:49:05Z" }, "Id": "test12", "CA10__disappearanceTime__c": null, "CA10__launchConfigurationName__c": "", "CA10A1__launchTemplateId__c": "", "CA10A1__launchTemplate__c": "", "CA10A1__mixedInstancesLaunchTemplateId__c": "mixedInstancesLaunchTemplateId12", "CA10A1__mixedInstancesLaunchTemplate__c": "mixedInstancesLaunchTemplate12", "CA10A1__launchTemplate__r": { "Id": null, "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 } }, "CA10A1__mixedInstancesLaunchTemplate__r": { "Id": "mixedInstancesLaunchTemplate12", "CA10A1__disappearanceTime__c": null, "CA10A1__latestVersion__c": "latestVersion12", "CA10A1__latestVersionUniqueId__c": "latestVersionUniqueId12", "CA10A1__latestVersion__r": { "Id": "latestVersion12", "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" - path: /types/CA10__CaAwsAutoScalingGroup__c/object.extracts.yaml md5Hash: DD26D73C0CF43F8CE9CBE35D8241D89C content: "---\nextracts:\n # AvailabilityZones.member.N\n # One or more Availability\ \ Zones for the group.\n # Type: Array of strings\n # Length Constraints:\ \ Minimum length of 1. Maximum length of 255.\n # Pattern: [\\u0020-\\uD7FF\\\ uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*\n # Required: Yes\n \ \ - name: CA10__availabilityZones__c\n value: \n FIELD:\n path:\ \ CA10__availabilityZones__c\n undeterminedIf:\n isEmpty: Corrupted\ \ data. Availability zones should always present\n - name: caSetFrom_availabilityZones__c\n\ \ value: \n SET_FROM:\n separator: \"\\n\"\n arg:\n \ \ EXTRACT: CA10__availabilityZones__c\n# A comma-separated value string\ \ of one or more health check types.\n# Values: EC2, EBS, ELB, VPC_LATTICE.\ \ Not nullable. Can't have no access, retrieved via autoscaling:DescribeAutoScalingGroups\n\ \ - name: CA10__healthCheckType__c\n value: \n FIELD:\n path:\ \ CA10__healthCheckType__c \n# Nullable. Can't have no access, retrieved\ \ via autoscaling:DescribeAutoScalingGroups \n - name: CA10__launchConfigurationName__c\n\ \ value: \n FIELD:\n path: CA10__launchConfigurationName__c \ \ \n# Nullable. Can't have no access, retrieved via autoscaling:DescribeAutoScalingGroups\ \ \n - name: CA10A1__launchTemplateId__c\n value: \n FIELD:\n \ \ path: CA10A1__launchTemplateId__c \n# Nullable. Can't have\ \ no access, retrieved via autoscaling:DescribeAutoScalingGroups \n - name:\ \ CA10A1__mixedInstancesLaunchTemplateId__c\n value: \n FIELD:\n \ \ path: CA10A1__mixedInstancesLaunchTemplateId__c \n# Values: Enable\ \ | Disable. Nullable, null == Disable. Can't have no access, retrieved via\ \ autoscaling:DescribeAutoScalingGroups \n - name: CA10__capacityRebalancing__c\n\ \ value: \n FIELD:\n path: CA10__capacityRebalancing__c \ \ \n" script: |- CREATE TEMP FUNCTION mock_ExpectedResult() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "Id" : "test1", "expectedResult" : { "status" : "DISAPPEARED", "conditionIndex" : "99", "conditionText" : "isDisappeared(CA10__disappearanceTime__c)", "runtimeError" : null } }, { "Id" : "test2", "expectedResult" : { "status" : "INAPPLICABLE", "conditionIndex" : "199", "conditionText" : "extract('CA10__launchConfigurationName__c').isNotEmpty()", "runtimeError" : null } }, { "Id" : "test3", "expectedResult" : { "status" : "UNDETERMINED", "conditionIndex" : "299", "conditionText" : "extract('CA10A1__launchTemplateId__c').isNotEmpty() && (isEmptyLookup('CA10A1__launchTemplate__r') || isEmptyLookup('CA10A1__launchTemplate__r.CA10A1__latestVersion__r'))", "runtimeError" : null } }, { "Id" : "test4", "expectedResult" : { "status" : "UNDETERMINED", "conditionIndex" : "299", "conditionText" : "extract('CA10A1__launchTemplateId__c').isNotEmpty() && (isEmptyLookup('CA10A1__launchTemplate__r') || isEmptyLookup('CA10A1__launchTemplate__r.CA10A1__latestVersion__r'))", "runtimeError" : null } }, { "Id" : "test5", "expectedResult" : { "status" : "UNDETERMINED", "conditionIndex" : "399", "conditionText" : "extract('CA10A1__mixedInstancesLaunchTemplateId__c').isNotEmpty() && (isEmptyLookup('CA10A1__mixedInstancesLaunchTemplate__r') || isEmptyLookup('CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r'))", "runtimeError" : null } }, { "Id" : "test6", "expectedResult" : { "status" : "UNDETERMINED", "conditionIndex" : "399", "conditionText" : "extract('CA10A1__mixedInstancesLaunchTemplateId__c').isNotEmpty() && (isEmptyLookup('CA10A1__mixedInstancesLaunchTemplate__r') || isEmptyLookup('CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r'))", "runtimeError" : null } }, { "Id" : "test7", "expectedResult" : { "status" : "INCOMPLIANT", "conditionIndex" : "499", "conditionText" : "extract('CA10A1__launchTemplateId__c').isNotEmpty() && extract('CA10A1__launchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c') == 'disabled'", "runtimeError" : null } }, { "Id" : "test8", "expectedResult" : { "status" : "INCOMPLIANT", "conditionIndex" : "599", "conditionText" : "extract('CA10A1__mixedInstancesLaunchTemplateId__c').isNotEmpty() && extract('CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c') == 'disabled'", "runtimeError" : null } }, { "Id" : "test9", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : "699", "conditionText" : "extract('CA10A1__launchTemplateId__c').isNotEmpty() && extract('CA10A1__launchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c') == 'required'", "runtimeError" : null } }, { "Id" : "test10", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : "799", "conditionText" : "extract('CA10A1__mixedInstancesLaunchTemplateId__c').isNotEmpty() && extract('CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c') == 'required'", "runtimeError" : null } }, { "Id" : "test11", "expectedResult" : { "status" : "INCOMPLIANT", "conditionIndex" : "800", "conditionText" : "otherwise", "runtimeError" : null } }, { "Id" : "test12", "expectedResult" : { "status" : "INCOMPLIANT", "conditionIndex" : "800", "conditionText" : "otherwise", "runtimeError" : null } } ]; """; CREATE TEMP FUNCTION mock_CA10__CaAwsAutoScalingGroup__c() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "CA10__disappearanceTime__c" : new Date("2025-06-17T15:05:27Z"), "CA10__launchConfigurationName__c" : "", "CA10A1__launchTemplateId__c" : "launchTemplateId1", "CA10A1__launchTemplate__c" : "launchTemplate1", "CA10A1__mixedInstancesLaunchTemplateId__c" : "", "CA10A1__mixedInstancesLaunchTemplate__c" : "", "Id" : "test1" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "CA10__launchConfigurationName__c" : "launchConfigurationName2", "CA10A1__launchTemplateId__c" : "", "CA10A1__launchTemplate__c" : "", "CA10A1__mixedInstancesLaunchTemplateId__c" : "", "CA10A1__mixedInstancesLaunchTemplate__c" : "", "Id" : "test2" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "CA10__launchConfigurationName__c" : "", "CA10A1__launchTemplateId__c" : "launchTemplateId3", "CA10A1__launchTemplate__c" : "launchTemplate3", "CA10A1__mixedInstancesLaunchTemplateId__c" : "", "CA10A1__mixedInstancesLaunchTemplate__c" : "", "Id" : "test3" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "CA10__launchConfigurationName__c" : "", "CA10A1__launchTemplateId__c" : "launchTemplateId4", "CA10A1__launchTemplate__c" : "launchTemplate4", "CA10A1__mixedInstancesLaunchTemplateId__c" : "", "CA10A1__mixedInstancesLaunchTemplate__c" : "", "Id" : "test4" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "CA10__launchConfigurationName__c" : "", "CA10A1__launchTemplateId__c" : "", "CA10A1__launchTemplate__c" : "", "CA10A1__mixedInstancesLaunchTemplateId__c" : "mixedInstancesLaunchTemplateId5", "CA10A1__mixedInstancesLaunchTemplate__c" : "mixedInstancesLaunchTemplate5", "Id" : "test5" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "CA10__launchConfigurationName__c" : "", "CA10A1__launchTemplateId__c" : "", "CA10A1__launchTemplate__c" : "", "CA10A1__mixedInstancesLaunchTemplateId__c" : "mixedInstancesLaunchTemplateId6", "CA10A1__mixedInstancesLaunchTemplate__c" : "mixedInstancesLaunchTemplate6", "Id" : "test6" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "CA10__launchConfigurationName__c" : "", "CA10A1__launchTemplateId__c" : "launchTemplateId7", "CA10A1__launchTemplate__c" : "launchTemplate7", "CA10A1__mixedInstancesLaunchTemplateId__c" : "", "CA10A1__mixedInstancesLaunchTemplate__c" : "", "Id" : "test7" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "CA10__launchConfigurationName__c" : "", "CA10A1__launchTemplateId__c" : "", "CA10A1__launchTemplate__c" : "", "CA10A1__mixedInstancesLaunchTemplateId__c" : "mixedInstancesLaunchTemplateId8", "CA10A1__mixedInstancesLaunchTemplate__c" : "mixedInstancesLaunchTemplate8", "Id" : "test8" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "CA10__launchConfigurationName__c" : "", "CA10A1__launchTemplateId__c" : "launchTemplateId9", "CA10A1__launchTemplate__c" : "launchTemplate9", "CA10A1__mixedInstancesLaunchTemplateId__c" : "", "CA10A1__mixedInstancesLaunchTemplate__c" : "", "Id" : "test9" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "CA10__launchConfigurationName__c" : "", "CA10A1__launchTemplateId__c" : "", "CA10A1__launchTemplate__c" : "", "CA10A1__mixedInstancesLaunchTemplateId__c" : "mixedInstancesLaunchTemplateId10", "CA10A1__mixedInstancesLaunchTemplate__c" : "mixedInstancesLaunchTemplate10", "Id" : "test10" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "CA10__launchConfigurationName__c" : "", "CA10A1__launchTemplateId__c" : "launchTemplateId11", "CA10A1__launchTemplate__c" : "launchTemplate11", "CA10A1__mixedInstancesLaunchTemplateId__c" : "", "CA10A1__mixedInstancesLaunchTemplate__c" : "", "Id" : "test11" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "CA10__launchConfigurationName__c" : "", "CA10A1__launchTemplateId__c" : "", "CA10A1__launchTemplate__c" : "", "CA10A1__mixedInstancesLaunchTemplateId__c" : "mixedInstancesLaunchTemplateId12", "CA10A1__mixedInstancesLaunchTemplate__c" : "mixedInstancesLaunchTemplate12", "Id" : "test12" } ]; """; CREATE TEMP FUNCTION mock_CA10A1__CaAwsEc2LaunchTemplate__c() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "Id" : "launchTemplate1", "CA10A1__disappearanceTime__c" : new Date("2025-06-17T17:40:24Z"), "CA10A1__latestVersion__c" : "latestVersion1", "CA10A1__latestVersionUniqueId__c" : "launchTemplateId1" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "Id" : null, "CA10A1__latestVersion__c" : null, "CA10A1__latestVersionUniqueId__c" : null }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "Id" : "launchTemplate3", "CA10A1__latestVersion__c" : "latestVersion3", "CA10A1__latestVersionUniqueId__c" : "launchTemplateId3" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "Id" : "launchTemplate4", "CA10A1__disappearanceTime__c" : new Date("2025-06-17T17:41:14Z"), "CA10A1__latestVersion__c" : "latestVersion4", "CA10A1__latestVersionUniqueId__c" : "launchTemplateId4" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "Id" : "mixedInstancesLaunchTemplate5", "CA10A1__latestVersion__c" : "latestVersion5", "CA10A1__latestVersionUniqueId__c" : "latestVersionUniqueId5" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "Id" : "mixedInstancesLaunchTemplate6", "CA10A1__disappearanceTime__c" : new Date("2025-06-22T18:49:05Z"), "CA10A1__latestVersion__c" : "latestVersion6", "CA10A1__latestVersionUniqueId__c" : "latestVersionUniqueId6" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "Id" : "launchTemplate7", "CA10A1__latestVersion__c" : "latestVersion7", "CA10A1__latestVersionUniqueId__c" : "launchTemplateId7" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "Id" : "mixedInstancesLaunchTemplate8", "CA10A1__latestVersion__c" : "latestVersion8", "CA10A1__latestVersionUniqueId__c" : "latestVersionUniqueId8" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "Id" : "launchTemplate9", "CA10A1__latestVersion__c" : "latestVersion9", "CA10A1__latestVersionUniqueId__c" : "launchTemplateId9" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "Id" : "mixedInstancesLaunchTemplate10", "CA10A1__latestVersion__c" : "latestVersion10", "CA10A1__latestVersionUniqueId__c" : "latestVersionUniqueId10" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "Id" : "launchTemplate11", "CA10A1__latestVersion__c" : "latestVersion11", "CA10A1__latestVersionUniqueId__c" : "launchTemplateId11" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "Id" : "mixedInstancesLaunchTemplate12", "CA10A1__latestVersion__c" : "latestVersion12", "CA10A1__latestVersionUniqueId__c" : "latestVersionUniqueId12" } ]; """; CREATE TEMP FUNCTION mock_CA10A1__CaAwsEc2LaunchTemplateVersion__c() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "Id" : "latestVersion1", "CA10A1__disappearanceTime__c" : new Date("2025-06-17T17:41:14Z"), "CA10A1__metadataHttpEndpoint__c" : "", "CA10A1__metadataHttpTokens__c" : "" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "Id" : null, "CA10A1__metadataHttpEndpoint__c" : null, "CA10A1__metadataHttpTokens__c" : null }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "Id" : "latestVersion3", "CA10A1__disappearanceTime__c" : new Date("2025-06-17T17:41:14Z"), "CA10A1__metadataHttpEndpoint__c" : "", "CA10A1__metadataHttpTokens__c" : "" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "Id" : "latestVersion4", "CA10A1__disappearanceTime__c" : new Date("2025-06-17T17:41:14Z"), "CA10A1__metadataHttpEndpoint__c" : "", "CA10A1__metadataHttpTokens__c" : "" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "Id" : "latestVersion5", "CA10A1__disappearanceTime__c" : new Date("2025-06-22T18:49:05Z"), "CA10A1__metadataHttpEndpoint__c" : "", "CA10A1__metadataHttpTokens__c" : "" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "Id" : "latestVersion6", "CA10A1__disappearanceTime__c" : new Date("2025-06-22T18:49:05Z"), "CA10A1__metadataHttpEndpoint__c" : "", "CA10A1__metadataHttpTokens__c" : "" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "Id" : "latestVersion7", "CA10A1__metadataHttpEndpoint__c" : "disabled", "CA10A1__metadataHttpTokens__c" : "" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "Id" : "latestVersion8", "CA10A1__metadataHttpEndpoint__c" : "disabled", "CA10A1__metadataHttpTokens__c" : "" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "Id" : "latestVersion9", "CA10A1__metadataHttpEndpoint__c" : "enabled", "CA10A1__metadataHttpTokens__c" : "required" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "Id" : "latestVersion10", "CA10A1__metadataHttpEndpoint__c" : "", "CA10A1__metadataHttpTokens__c" : "required" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "Id" : "latestVersion11", "CA10A1__metadataHttpEndpoint__c" : "enabled", "CA10A1__metadataHttpTokens__c" : "optional" }, { "context" : { "snapshotTime" : new Date("2025-06-22T18:49:05Z") }, "Id" : "latestVersion12", "CA10A1__metadataHttpEndpoint__c" : "", "CA10A1__metadataHttpTokens__c" : "" } ]; """; CREATE TEMP FUNCTION process_CA10__CaAwsAutoScalingGroup__c( obj STRUCT< CA10__disappearanceTime__c TIMESTAMP, CA10__launchConfigurationName__c STRING, CA10A1__launchTemplateId__c STRING, CA10A1__launchTemplate__c STRING, CA10A1__mixedInstancesLaunchTemplateId__c STRING, CA10A1__mixedInstancesLaunchTemplate__c STRING, Id STRING, CA10A1__launchTemplate__r STRUCT< Id STRING, CA10A1__disappearanceTime__c TIMESTAMP, CA10A1__latestVersion__c STRING, CA10A1__latestVersionUniqueId__c STRING, CA10A1__latestVersion__r STRUCT< Id STRING, CA10A1__disappearanceTime__c TIMESTAMP, CA10A1__metadataHttpEndpoint__c STRING, CA10A1__metadataHttpTokens__c STRING > >, CA10A1__mixedInstancesLaunchTemplate__r STRUCT< Id STRING, CA10A1__disappearanceTime__c TIMESTAMP, CA10A1__latestVersion__c STRING, CA10A1__latestVersionUniqueId__c 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 [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__launchConfigurationName__c; } return this.out; }; references1.push('Launch Configuration Name [obj.CA10__launchConfigurationName__c]: ' + obj.CA10__launchConfigurationName__c); if (TextLib.isNotEmpty(extract3.call(extract3))) { return {status: 'INAPPLICABLE', conditionIndex: 199, conditionText: "extract('CA10__launchConfigurationName__c').isNotEmpty()", currentStateMessage: "The Auto Scaling group uses a launch configuration.", currentStateReferences: references1.join('\n'), remediation: "Migrate the Auto Scaling group to a launch template.", runtimeError: null}; } // condition[2], conditionIndex:[200..299] function extract6() { if (!this.out) { this.out = obj.CA10A1__launchTemplateId__c; } return this.out; }; references1.push('Launch Template ID [obj.CA10A1__launchTemplateId__c]: ' + obj.CA10A1__launchTemplateId__c); if (TextLib.isNotEmpty(extract6.call(extract6)) && ((TextLib.isEmpty(obj.CA10A1__launchTemplateId__c) || TextLib.isEmpty(obj.CA10A1__launchTemplate__c) || obj.CA10A1__launchTemplate__r.CA10A1__disappearanceTime__c != null) || (TextLib.isEmpty(obj.CA10A1__launchTemplateId__c) || TextLib.isEmpty(obj.CA10A1__launchTemplate__c) || obj.CA10A1__launchTemplate__r.CA10A1__disappearanceTime__c != null || TextLib.isEmpty(obj.CA10A1__launchTemplate__r.CA10A1__latestVersionUniqueId__c) || TextLib.isEmpty(obj.CA10A1__launchTemplate__r.CA10A1__latestVersion__c) || obj.CA10A1__launchTemplate__r.CA10A1__latestVersion__r.CA10A1__disappearanceTime__c != null))) { return {status: 'UNDETERMINED', conditionIndex: 299, conditionText: "extract('CA10A1__launchTemplateId__c').isNotEmpty() && (isEmptyLookup('CA10A1__launchTemplate__r') || isEmptyLookup('CA10A1__launchTemplate__r.CA10A1__latestVersion__r'))", currentStateMessage: "The launch template is not present in the CMDB.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } // condition[3], conditionIndex:[300..399] function extract9() { if (!this.out) { this.out = obj.CA10A1__mixedInstancesLaunchTemplateId__c; } return this.out; }; references1.push('Mixed Instances Launch Template ID [obj.CA10A1__mixedInstancesLaunchTemplateId__c]: ' + obj.CA10A1__mixedInstancesLaunchTemplateId__c); if (TextLib.isNotEmpty(extract9.call(extract9)) && ((TextLib.isEmpty(obj.CA10A1__mixedInstancesLaunchTemplateId__c) || TextLib.isEmpty(obj.CA10A1__mixedInstancesLaunchTemplate__c) || obj.CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__disappearanceTime__c != null) || (TextLib.isEmpty(obj.CA10A1__mixedInstancesLaunchTemplateId__c) || TextLib.isEmpty(obj.CA10A1__mixedInstancesLaunchTemplate__c) || obj.CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__disappearanceTime__c != null || TextLib.isEmpty(obj.CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersionUniqueId__c) || TextLib.isEmpty(obj.CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__c) || obj.CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r.CA10A1__disappearanceTime__c != null))) { return {status: 'UNDETERMINED', conditionIndex: 399, conditionText: "extract('CA10A1__mixedInstancesLaunchTemplateId__c').isNotEmpty() && (isEmptyLookup('CA10A1__mixedInstancesLaunchTemplate__r') || isEmptyLookup('CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r'))", currentStateMessage: "The launch template is not present in the CMDB.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } // condition[4], conditionIndex:[400..499] function extract12() { if (!this.out) { this.out = obj.CA10A1__launchTemplateId__c; } return this.out; }; function extractChecked14() { if (TextLib.isEmpty(obj.CA10A1__launchTemplateId__c)) { throw new Error("UNDETERMINED condition:401", {cause: {status: 'UNDETERMINED', conditionIndex: 401, conditionText: "extractCheck(obj.CA10A1__launchTemplateId__c)", currentStateMessage: "Related object via CA10A1__launchTemplateId__c has empty ID", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } if (TextLib.isEmpty(obj.CA10A1__launchTemplate__c)) { throw new Error("UNDETERMINED condition:402", {cause: {status: 'UNDETERMINED', conditionIndex: 402, conditionText: "extractCheck(obj.CA10A1__launchTemplate__c)", currentStateMessage: "Related object via CA10A1__launchTemplate__c is not present", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } if (obj.CA10A1__launchTemplate__r.CA10A1__disappearanceTime__c != null) { throw new Error("UNDETERMINED condition:403", {cause: {status: 'UNDETERMINED', conditionIndex: 403, conditionText: "extractCheck(obj.CA10A1__launchTemplate__r.CA10A1__disappearanceTime__c)", currentStateMessage: "Related object via CA10A1__launchTemplate__c is present, but deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } if (TextLib.isEmpty(obj.CA10A1__launchTemplate__r.CA10A1__latestVersionUniqueId__c)) { throw new Error("UNDETERMINED condition:404", {cause: {status: 'UNDETERMINED', conditionIndex: 404, conditionText: "extractCheck(obj.CA10A1__launchTemplate__r.CA10A1__latestVersionUniqueId__c)", currentStateMessage: "Related object via CA10A1__launchTemplate__r.CA10A1__latestVersionUniqueId__c has empty ID", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } if (TextLib.isEmpty(obj.CA10A1__launchTemplate__r.CA10A1__latestVersion__c)) { throw new Error("UNDETERMINED condition:405", {cause: {status: 'UNDETERMINED', conditionIndex: 405, conditionText: "extractCheck(obj.CA10A1__launchTemplate__r.CA10A1__latestVersion__c)", currentStateMessage: "Related object via CA10A1__launchTemplate__r.CA10A1__latestVersion__c is not present", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } if (obj.CA10A1__launchTemplate__r.CA10A1__latestVersion__r.CA10A1__disappearanceTime__c != null) { throw new Error("UNDETERMINED condition:406", {cause: {status: 'UNDETERMINED', conditionIndex: 406, conditionText: "extractCheck(obj.CA10A1__launchTemplate__r.CA10A1__latestVersion__r.CA10A1__disappearanceTime__c)", currentStateMessage: "Related object via CA10A1__launchTemplate__r.CA10A1__latestVersion__c is present, but deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } return extract15.call(extract15); } function extract15() { if (!this.out) { this.out = obj.CA10A1__launchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c; } return this.out; }; references1.push('Metadata HTTP Endpoint [obj.CA10A1__launchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c]: ' + obj.CA10A1__launchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c); try { if (TextLib.isNotEmpty(extract12.call(extract12)) && TextLib.equal(extractChecked14(), 'disabled')) { return {status: 'INCOMPLIANT', conditionIndex: 499, conditionText: "extract('CA10A1__launchTemplateId__c').isNotEmpty() && extract('CA10A1__launchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c') == 'disabled'", currentStateMessage: "Access to the HTTP endpoint of the instance metadata service is disabled.", currentStateReferences: references1.join('\n'), remediation: "Enable access to the instance metadata service.", runtimeError: null}; } } catch (err) { if (err.cause && err.cause.status) { return err.cause; } else { throw err; } } // condition[5], conditionIndex:[500..599] function extract18() { if (!this.out) { this.out = obj.CA10A1__mixedInstancesLaunchTemplateId__c; } return this.out; }; function extractChecked20() { if (TextLib.isEmpty(obj.CA10A1__mixedInstancesLaunchTemplateId__c)) { throw new Error("UNDETERMINED condition:501", {cause: {status: 'UNDETERMINED', conditionIndex: 501, conditionText: "extractCheck(obj.CA10A1__mixedInstancesLaunchTemplateId__c)", currentStateMessage: "Related object via CA10A1__mixedInstancesLaunchTemplateId__c has empty ID", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } if (TextLib.isEmpty(obj.CA10A1__mixedInstancesLaunchTemplate__c)) { throw new Error("UNDETERMINED condition:502", {cause: {status: 'UNDETERMINED', conditionIndex: 502, conditionText: "extractCheck(obj.CA10A1__mixedInstancesLaunchTemplate__c)", currentStateMessage: "Related object via CA10A1__mixedInstancesLaunchTemplate__c is not present", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } if (obj.CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__disappearanceTime__c != null) { throw new Error("UNDETERMINED condition:503", {cause: {status: 'UNDETERMINED', conditionIndex: 503, conditionText: "extractCheck(obj.CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__disappearanceTime__c)", currentStateMessage: "Related object via CA10A1__mixedInstancesLaunchTemplate__c is present, but deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } if (TextLib.isEmpty(obj.CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersionUniqueId__c)) { throw new Error("UNDETERMINED condition:504", {cause: {status: 'UNDETERMINED', conditionIndex: 504, conditionText: "extractCheck(obj.CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersionUniqueId__c)", currentStateMessage: "Related object via CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersionUniqueId__c has empty ID", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } if (TextLib.isEmpty(obj.CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__c)) { throw new Error("UNDETERMINED condition:505", {cause: {status: 'UNDETERMINED', conditionIndex: 505, conditionText: "extractCheck(obj.CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__c)", currentStateMessage: "Related object via CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__c is not present", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } if (obj.CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r.CA10A1__disappearanceTime__c != null) { throw new Error("UNDETERMINED condition:506", {cause: {status: 'UNDETERMINED', conditionIndex: 506, conditionText: "extractCheck(obj.CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r.CA10A1__disappearanceTime__c)", currentStateMessage: "Related object via CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__c is present, but deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } return extract21.call(extract21); } function extract21() { if (!this.out) { this.out = obj.CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c; } return this.out; }; references1.push('Metadata HTTP Endpoint [obj.CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c]: ' + obj.CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c); try { if (TextLib.isNotEmpty(extract18.call(extract18)) && TextLib.equal(extractChecked20(), 'disabled')) { return {status: 'INCOMPLIANT', conditionIndex: 599, conditionText: "extract('CA10A1__mixedInstancesLaunchTemplateId__c').isNotEmpty() && extract('CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpEndpoint__c') == 'disabled'", currentStateMessage: "Access to the HTTP endpoint of the instance metadata service is disabled.", currentStateReferences: references1.join('\n'), remediation: "Enable access to the instance metadata service.", runtimeError: null}; } } catch (err) { if (err.cause && err.cause.status) { return err.cause; } else { throw err; } } // condition[6], conditionIndex:[600..699] function extract24() { if (!this.out) { this.out = obj.CA10A1__launchTemplateId__c; } return this.out; }; function extractChecked26() { if (TextLib.isEmpty(obj.CA10A1__launchTemplateId__c)) { throw new Error("UNDETERMINED condition:601", {cause: {status: 'UNDETERMINED', conditionIndex: 601, conditionText: "extractCheck(obj.CA10A1__launchTemplateId__c)", currentStateMessage: "Related object via CA10A1__launchTemplateId__c has empty ID", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } if (TextLib.isEmpty(obj.CA10A1__launchTemplate__c)) { throw new Error("UNDETERMINED condition:602", {cause: {status: 'UNDETERMINED', conditionIndex: 602, conditionText: "extractCheck(obj.CA10A1__launchTemplate__c)", currentStateMessage: "Related object via CA10A1__launchTemplate__c is not present", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } if (obj.CA10A1__launchTemplate__r.CA10A1__disappearanceTime__c != null) { throw new Error("UNDETERMINED condition:603", {cause: {status: 'UNDETERMINED', conditionIndex: 603, conditionText: "extractCheck(obj.CA10A1__launchTemplate__r.CA10A1__disappearanceTime__c)", currentStateMessage: "Related object via CA10A1__launchTemplate__c is present, but deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } if (TextLib.isEmpty(obj.CA10A1__launchTemplate__r.CA10A1__latestVersionUniqueId__c)) { throw new Error("UNDETERMINED condition:604", {cause: {status: 'UNDETERMINED', conditionIndex: 604, conditionText: "extractCheck(obj.CA10A1__launchTemplate__r.CA10A1__latestVersionUniqueId__c)", currentStateMessage: "Related object via CA10A1__launchTemplate__r.CA10A1__latestVersionUniqueId__c has empty ID", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } if (TextLib.isEmpty(obj.CA10A1__launchTemplate__r.CA10A1__latestVersion__c)) { throw new Error("UNDETERMINED condition:605", {cause: {status: 'UNDETERMINED', conditionIndex: 605, conditionText: "extractCheck(obj.CA10A1__launchTemplate__r.CA10A1__latestVersion__c)", currentStateMessage: "Related object via CA10A1__launchTemplate__r.CA10A1__latestVersion__c is not present", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } if (obj.CA10A1__launchTemplate__r.CA10A1__latestVersion__r.CA10A1__disappearanceTime__c != null) { throw new Error("UNDETERMINED condition:606", {cause: {status: 'UNDETERMINED', conditionIndex: 606, conditionText: "extractCheck(obj.CA10A1__launchTemplate__r.CA10A1__latestVersion__r.CA10A1__disappearanceTime__c)", currentStateMessage: "Related object via CA10A1__launchTemplate__r.CA10A1__latestVersion__c is present, but deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } return extract27.call(extract27); } function extract27() { if (!this.out) { this.out = obj.CA10A1__launchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c; } return this.out; }; references1.push('Metadata HTTP Tokens [obj.CA10A1__launchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c]: ' + obj.CA10A1__launchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c); try { if (TextLib.isNotEmpty(extract24.call(extract24)) && TextLib.equal(extractChecked26(), 'required')) { return {status: 'COMPLIANT', conditionIndex: 699, conditionText: "extract('CA10A1__launchTemplateId__c').isNotEmpty() && extract('CA10A1__launchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c') == 'required'", currentStateMessage: "The launch template settings require IMDSv2.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; } } catch (err) { if (err.cause && err.cause.status) { return err.cause; } else { throw err; } } // condition[7], conditionIndex:[700..799] function extract30() { if (!this.out) { this.out = obj.CA10A1__mixedInstancesLaunchTemplateId__c; } return this.out; }; function extractChecked32() { if (TextLib.isEmpty(obj.CA10A1__mixedInstancesLaunchTemplateId__c)) { throw new Error("UNDETERMINED condition:701", {cause: {status: 'UNDETERMINED', conditionIndex: 701, conditionText: "extractCheck(obj.CA10A1__mixedInstancesLaunchTemplateId__c)", currentStateMessage: "Related object via CA10A1__mixedInstancesLaunchTemplateId__c has empty ID", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } if (TextLib.isEmpty(obj.CA10A1__mixedInstancesLaunchTemplate__c)) { throw new Error("UNDETERMINED condition:702", {cause: {status: 'UNDETERMINED', conditionIndex: 702, conditionText: "extractCheck(obj.CA10A1__mixedInstancesLaunchTemplate__c)", currentStateMessage: "Related object via CA10A1__mixedInstancesLaunchTemplate__c is not present", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } if (obj.CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__disappearanceTime__c != null) { throw new Error("UNDETERMINED condition:703", {cause: {status: 'UNDETERMINED', conditionIndex: 703, conditionText: "extractCheck(obj.CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__disappearanceTime__c)", currentStateMessage: "Related object via CA10A1__mixedInstancesLaunchTemplate__c is present, but deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } if (TextLib.isEmpty(obj.CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersionUniqueId__c)) { throw new Error("UNDETERMINED condition:704", {cause: {status: 'UNDETERMINED', conditionIndex: 704, conditionText: "extractCheck(obj.CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersionUniqueId__c)", currentStateMessage: "Related object via CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersionUniqueId__c has empty ID", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } if (TextLib.isEmpty(obj.CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__c)) { throw new Error("UNDETERMINED condition:705", {cause: {status: 'UNDETERMINED', conditionIndex: 705, conditionText: "extractCheck(obj.CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__c)", currentStateMessage: "Related object via CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__c is not present", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } if (obj.CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r.CA10A1__disappearanceTime__c != null) { throw new Error("UNDETERMINED condition:706", {cause: {status: 'UNDETERMINED', conditionIndex: 706, conditionText: "extractCheck(obj.CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r.CA10A1__disappearanceTime__c)", currentStateMessage: "Related object via CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__c is present, but deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}}); } return extract33.call(extract33); } function extract33() { if (!this.out) { this.out = obj.CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c; } return this.out; }; references1.push('Metadata HTTP Tokens [obj.CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c]: ' + obj.CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c); try { if (TextLib.isNotEmpty(extract30.call(extract30)) && TextLib.equal(extractChecked32(), 'required')) { return {status: 'COMPLIANT', conditionIndex: 799, conditionText: "extract('CA10A1__mixedInstancesLaunchTemplateId__c').isNotEmpty() && extract('CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r.CA10A1__metadataHttpTokens__c') == 'required'", currentStateMessage: "The launch template settings require 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: 800, conditionText: "otherwise", currentStateMessage: "IMDSv2 is not required when requesting instance metadata.", currentStateReferences: references1.join('\n'), remediation: "Configure the template to require 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.CA10__disappearanceTime__c AS CA10__disappearanceTime__c, sObject.CA10__launchConfigurationName__c AS CA10__launchConfigurationName__c, sObject.CA10A1__launchTemplateId__c AS CA10A1__launchTemplateId__c, sObject.CA10A1__launchTemplate__c AS CA10A1__launchTemplate__c, sObject.CA10A1__mixedInstancesLaunchTemplateId__c AS CA10A1__mixedInstancesLaunchTemplateId__c, sObject.CA10A1__mixedInstancesLaunchTemplate__c AS CA10A1__mixedInstancesLaunchTemplate__c, sObject.Id AS Id, STRUCT ( `CA10A1__launchTemplate__r`.Id AS Id, `CA10A1__launchTemplate__r`.CA10A1__disappearanceTime__c AS CA10A1__disappearanceTime__c, `CA10A1__launchTemplate__r`.CA10A1__latestVersion__c AS CA10A1__latestVersion__c, `CA10A1__launchTemplate__r`.CA10A1__latestVersionUniqueId__c AS CA10A1__latestVersionUniqueId__c, STRUCT ( `CA10A1__launchTemplate__r.CA10A1__latestVersion__r`.Id AS Id, `CA10A1__launchTemplate__r.CA10A1__latestVersion__r`.CA10A1__disappearanceTime__c AS CA10A1__disappearanceTime__c, `CA10A1__launchTemplate__r.CA10A1__latestVersion__r`.CA10A1__metadataHttpEndpoint__c AS CA10A1__metadataHttpEndpoint__c, `CA10A1__launchTemplate__r.CA10A1__latestVersion__r`.CA10A1__metadataHttpTokens__c AS CA10A1__metadataHttpTokens__c ) AS CA10A1__latestVersion__r ) AS CA10A1__launchTemplate__r, STRUCT ( `CA10A1__mixedInstancesLaunchTemplate__r`.Id AS Id, `CA10A1__mixedInstancesLaunchTemplate__r`.CA10A1__disappearanceTime__c AS CA10A1__disappearanceTime__c, `CA10A1__mixedInstancesLaunchTemplate__r`.CA10A1__latestVersion__c AS CA10A1__latestVersion__c, `CA10A1__mixedInstancesLaunchTemplate__r`.CA10A1__latestVersionUniqueId__c AS CA10A1__latestVersionUniqueId__c, STRUCT ( `CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r`.Id AS Id, `CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r`.CA10A1__disappearanceTime__c AS CA10A1__disappearanceTime__c, `CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r`.CA10A1__metadataHttpEndpoint__c AS CA10A1__metadataHttpEndpoint__c, `CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r`.CA10A1__metadataHttpTokens__c AS CA10A1__metadataHttpTokens__c ) AS CA10A1__latestVersion__r ) AS CA10A1__mixedInstancesLaunchTemplate__r, process_CA10__CaAwsAutoScalingGroup__c( STRUCT( sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c, sObject.CA10__launchConfigurationName__c AS CA10__launchConfigurationName__c, sObject.CA10A1__launchTemplateId__c AS CA10A1__launchTemplateId__c, sObject.CA10A1__launchTemplate__c AS CA10A1__launchTemplate__c, sObject.CA10A1__mixedInstancesLaunchTemplateId__c AS CA10A1__mixedInstancesLaunchTemplateId__c, sObject.CA10A1__mixedInstancesLaunchTemplate__c AS CA10A1__mixedInstancesLaunchTemplate__c, sObject.Id AS Id, STRUCT ( `CA10A1__launchTemplate__r`.Id AS Id, `CA10A1__launchTemplate__r`.CA10A1__disappearanceTime__c AS CA10A1__disappearanceTime__c, `CA10A1__launchTemplate__r`.CA10A1__latestVersion__c AS CA10A1__latestVersion__c, `CA10A1__launchTemplate__r`.CA10A1__latestVersionUniqueId__c AS CA10A1__latestVersionUniqueId__c, STRUCT ( `CA10A1__launchTemplate__r.CA10A1__latestVersion__r`.Id AS Id, `CA10A1__launchTemplate__r.CA10A1__latestVersion__r`.CA10A1__disappearanceTime__c AS CA10A1__disappearanceTime__c, `CA10A1__launchTemplate__r.CA10A1__latestVersion__r`.CA10A1__metadataHttpEndpoint__c AS CA10A1__metadataHttpEndpoint__c, `CA10A1__launchTemplate__r.CA10A1__latestVersion__r`.CA10A1__metadataHttpTokens__c AS CA10A1__metadataHttpTokens__c ) AS CA10A1__latestVersion__r ) AS CA10A1__launchTemplate__r, STRUCT ( `CA10A1__mixedInstancesLaunchTemplate__r`.Id AS Id, `CA10A1__mixedInstancesLaunchTemplate__r`.CA10A1__disappearanceTime__c AS CA10A1__disappearanceTime__c, `CA10A1__mixedInstancesLaunchTemplate__r`.CA10A1__latestVersion__c AS CA10A1__latestVersion__c, `CA10A1__mixedInstancesLaunchTemplate__r`.CA10A1__latestVersionUniqueId__c AS CA10A1__latestVersionUniqueId__c, STRUCT ( `CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r`.Id AS Id, `CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r`.CA10A1__disappearanceTime__c AS CA10A1__disappearanceTime__c, `CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r`.CA10A1__metadataHttpEndpoint__c AS CA10A1__metadataHttpEndpoint__c, `CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r`.CA10A1__metadataHttpTokens__c AS CA10A1__metadataHttpTokens__c ) AS CA10A1__latestVersion__r ) AS CA10A1__mixedInstancesLaunchTemplate__r ), sObject.context.snapshotTime ) as result FROM UNNEST(mock_CA10__CaAwsAutoScalingGroup__c()) AS sObject LEFT JOIN UNNEST(mock_CA10A1__CaAwsEc2LaunchTemplate__c()) AS `CA10A1__launchTemplate__r` ON sObject.CA10A1__launchTemplate__c = `CA10A1__launchTemplate__r`.Id LEFT JOIN UNNEST(mock_CA10A1__CaAwsEc2LaunchTemplateVersion__c()) AS `CA10A1__launchTemplate__r.CA10A1__latestVersion__r` ON `CA10A1__launchTemplate__r`.CA10A1__latestVersion__c = `CA10A1__launchTemplate__r.CA10A1__latestVersion__r`.Id LEFT JOIN UNNEST(mock_CA10A1__CaAwsEc2LaunchTemplate__c()) AS `CA10A1__mixedInstancesLaunchTemplate__r` ON sObject.CA10A1__mixedInstancesLaunchTemplate__c = `CA10A1__mixedInstancesLaunchTemplate__r`.Id LEFT JOIN UNNEST(mock_CA10A1__CaAwsEc2LaunchTemplateVersion__c()) AS `CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r` ON `CA10A1__mixedInstancesLaunchTemplate__r`.CA10A1__latestVersion__c = `CA10A1__mixedInstancesLaunchTemplate__r.CA10A1__latestVersion__r`.Id ) sObject ON sObject.Id = expectedResult.Id;