--- policy: /ce/ca/azure/sql-managed-instance/instance-cost-effective-region logic: /ce/ca/azure/sql-managed-instance/instance-cost-effective-region/prod.logic.yaml executionTime: 2026-02-10T22:33:36.915871783Z generationMs: 58 executionMs: 648 rows: - id: '001' match: true status: expected: DISAPPEARED actual: DISAPPEARED conditionIndex: expected: 99 actual: 99 conditionText: expected: isDisappeared(CA10Z1__disappearanceTime__c) actual: isDisappeared(CA10Z1__disappearanceTime__c) runtimeError: {} - id: '002' match: true status: expected: INCOMPLIANT actual: INCOMPLIANT conditionIndex: expected: 1199 actual: 1199 conditionText: expected: extract('CA10Z1__locationName__c') == 'westeurope' actual: extract('CA10Z1__locationName__c') == 'westeurope' runtimeError: {} - id: '003' match: true status: expected: COMPLIANT actual: COMPLIANT conditionIndex: expected: 2400 actual: 2400 conditionText: expected: otherwise actual: otherwise runtimeError: {} usedFiles: - path: /ce/ca/azure/sql-managed-instance/instance-cost-effective-region/policy.yaml md5Hash: 94FCB4748600D10BB06DC936ADE11332 content: | --- names: full: "Azure SQL Managed Instance is located in a less cost-effective region" contextual: "Managed Instance is located in a less cost-effective region" description: "This policy flags SQL Managed Instance that are running in Azure regions\ \ with higher pricing and could potentially be migrated to more cost-effective regions." type: "BEST_PRACTICE" categories: - "COST" frameworkMappings: - "/frameworks/cloudaware/cost-efficiency-and-optimization/resource-optimization" - path: /ce/ca/azure/sql-managed-instance/instance-cost-effective-region/prod.logic.yaml md5Hash: BB59DCC7C3FC75DAFF19A8B1ED480808 content: |+ --- inputType: "CA10Z1__CaAzureSqlManagedInstance__c" importExtracts: - file: "/types/CA10Z1__CaAzureSqlManagedInstance__c/object.extracts.yaml" testData: - file: 'test-data.json' conditions: - status: "INCOMPLIANT" currentStateMessage: "The instance is running in westus which is more expensive than westus3 or westus2." remediationMessage: "Migrate the instance to westus3 or westus2." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "westus" - status: "INCOMPLIANT" currentStateMessage: "The instance is running in westcentralus which is more expensive than westus3 or westus2." remediationMessage: "Migrate the instance to westus3 or westus2." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "westcentralus" - status: "INCOMPLIANT" currentStateMessage: "The instance is running in southcentralus which is more expensive than northcentralus, westus3 or westus2." remediationMessage: "Migrate the instance to northcentralus, westus3 or westus2." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "southcentralus" - status: "INCOMPLIANT" currentStateMessage: "The instance is running in centralus which is more expensive than northcentralus, westus3 or westus2." remediationMessage: "Migrate the instance to northcentralus, westus3 or westus2." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "centralus" - status: "INCOMPLIANT" currentStateMessage: "The instance is running in canadaeast which is more expensive than eastus or eastus2." remediationMessage: "Migrate the instance to eastus or eastus2." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "canadaeast" - status: "INCOMPLIANT" currentStateMessage: "The instance is running in canadacentral which is more expensive than eastus or eastus2." remediationMessage: "Migrate the instance to eastus or eastus2." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "canadacentral" - status: "INCOMPLIANT" currentStateMessage: "The instance is running in ukwest which is more expensive than eu-west-1, eu-north-1, or eu-south-2." remediationMessage: "Migrate the instance to eu-west-1, eu-north-1, or eu-south-2." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "ukwest" - status: "INCOMPLIANT" currentStateMessage: "The instance is running in uksouth which is more expensive than eu-west-1, eu-north-1, or eu-south-2." remediationMessage: "Migrate the instance to eu-west-1, eu-north-1, or eu-south-2." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "uksouth" - status: "INCOMPLIANT" currentStateMessage: "The instance is running in francecentral which is more expensive than eu-west-1, eu-north-1, or eu-south-2." remediationMessage: "Migrate the instance to eu-west-1, eu-north-1, or eu-south-2." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "francecentral" - status: "INCOMPLIANT" currentStateMessage: "The instance is running in francesouth which is more expensive than eu-west-1, eu-north-1, or eu-south-2." remediationMessage: "Migrate the instance to eu-west-1, eu-north-1, or eu-south-2." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "francesouth" - status: "INCOMPLIANT" currentStateMessage: "The instance is running in westeurope which is more expensive than northeurope." remediationMessage: "Migrate the instance to northeurope." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "westeurope" - status: "INCOMPLIANT" currentStateMessage: "The instance is running in germanywestcentral which is more expensive than northeurope." remediationMessage: "Migrate the instance to northeurope." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "germanywestcentral" - status: "INCOMPLIANT" currentStateMessage: "The instance is running in germanynorth which is more expensive than northeurope." remediationMessage: "Migrate the instance to northeurope." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "germanynorth" - status: "INCOMPLIANT" currentStateMessage: "The instance is running in switzerlandnorth which is more expensive than northeurope." remediationMessage: "Migrate the instance to northeurope." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "switzerlandnorth" - status: "INCOMPLIANT" currentStateMessage: "The instance is running in switzerlandwest which is more expensive than northeurope." remediationMessage: "Migrate the instance to northeurope." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "switzerlandwest" - status: "INCOMPLIANT" currentStateMessage: "The instance is running in italynorth which is more expensive than northeurope." remediationMessage: "Migrate the instance to northeurope." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "italynorth" - status: "INCOMPLIANT" currentStateMessage: "The instance is running in polandcentral which is more expensive than northeurope." remediationMessage: "Migrate the instance to northeurope." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "polandcentral" - status: "INCOMPLIANT" currentStateMessage: "The instance is running in norwayeast which is more expensive than northeurope." remediationMessage: "Migrate the instance to northeurope." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "norwayeast" - status: "INCOMPLIANT" currentStateMessage: "The instance is running in norwaywest which is more expensive than northeurope." remediationMessage: "Migrate the instance to northeurope." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "norwaywest" - status: "INCOMPLIANT" currentStateMessage: "The instance is running in swedensouth which is more expensive than northeurope." remediationMessage: "Migrate the instance to northeurope." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "swedensouth" - status: "INCOMPLIANT" currentStateMessage: "The instance is running in spaincentral which is more expensive than northeurope." remediationMessage: "Migrate the instance to northeurope." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "spaincentral" - status: "INCOMPLIANT" currentStateMessage: "The instance is running in southindia which is more expensive than centralindia or westindia." remediationMessage: "Migrate the instance to centralindia or westindia." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "southindia" - status: "INCOMPLIANT" currentStateMessage: "The instance is running in japanwest which is more expensive than koreasouth, japaneast or koreacentral." remediationMessage: "Migrate the instance to koreasouth, japaneast or koreacentral." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "japanwest" otherwise: status: "COMPLIANT" currentStateMessage: "The instance is located in a cost-effective region." - path: /ce/ca/azure/sql-managed-instance/instance-cost-effective-region/test-data.json md5Hash: AF94211BE7958485C7C5C69362FE3676 content: | [ { "expectedResult": { "status": "DISAPPEARED", "conditionIndex": "99", "conditionText": "isDisappeared(CA10Z1__disappearanceTime__c)", "runtimeError": null }, "context": { "snapshotTime": "2025-09-25T05:52:33Z" }, "Id": "001", "CA10Z1__disappearanceTime__c": "2025-09-15T13:47:23Z", "CA10Z1__locationName__c": "westeurope" }, { "expectedResult": { "status": "INCOMPLIANT", "conditionIndex": "1199", "conditionText": "extract('CA10Z1__locationName__c') == 'westeurope'", "runtimeError": null }, "context": { "snapshotTime": "2025-09-25T05:52:33Z" }, "Id": "002", "CA10Z1__disappearanceTime__c": null, "CA10Z1__locationName__c": "westeurope" }, { "expectedResult": { "status": "COMPLIANT", "conditionIndex": "2400", "conditionText": "otherwise", "runtimeError": null }, "context": { "snapshotTime": "2025-09-25T05:52:33Z" }, "Id": "003", "CA10Z1__disappearanceTime__c": null, "CA10Z1__locationName__c": "southeastasia" } ] - path: /types/CA10Z1__CaAzureSqlManagedInstance__c/object.extracts.yaml md5Hash: CEB619A9B852A33627260BC10279728E content: "---\nextracts:\n# Not nullable \n - name: \"CA10Z1__state__c\"\n \ \ value: \n FIELD:\n path: \"CA10Z1__state__c\"\n# Nullable \n\ \ - name: \"CA10Z1__monitorCpuPercentAvg30Day__c\"\n value: \n FIELD:\n\ \ path: \"CA10Z1__monitorCpuPercentAvg30Day__c\"\n# Nullable \n - name:\ \ \"CA10Z1__monitorIoWrittenMbAvg30Day__c\"\n value: \n FIELD:\n \ \ path: \"CA10Z1__monitorIoWrittenMbAvg30Day__c\"\n# Nullable \n - name:\ \ \"CA10Z1__monitorIoReadMbAvg30Day__c\"\n value: \n FIELD:\n \ \ path: \"CA10Z1__monitorIoReadMbAvg30Day__c\"\n# Text \n - name: \"CA10Z1__locationName__c\"\ \n value: \n FIELD:\n path: \"CA10Z1__locationName__c\"\n" script: |- CREATE TEMP FUNCTION mock_ExpectedResult() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "Id" : "001", "expectedResult" : { "status" : "DISAPPEARED", "conditionIndex" : "99", "conditionText" : "isDisappeared(CA10Z1__disappearanceTime__c)", "runtimeError" : null } }, { "Id" : "002", "expectedResult" : { "status" : "INCOMPLIANT", "conditionIndex" : "1199", "conditionText" : "extract('CA10Z1__locationName__c') == 'westeurope'", "runtimeError" : null } }, { "Id" : "003", "expectedResult" : { "status" : "COMPLIANT", "conditionIndex" : "2400", "conditionText" : "otherwise", "runtimeError" : null } } ]; """; CREATE TEMP FUNCTION mock_CA10Z1__CaAzureSqlManagedInstance__c() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "context" : { "snapshotTime" : new Date("2025-09-25T05:52:33Z") }, "CA10Z1__disappearanceTime__c" : new Date("2025-09-15T13:47:23Z"), "CA10Z1__locationName__c" : "westeurope", "Id" : "001" }, { "context" : { "snapshotTime" : new Date("2025-09-25T05:52:33Z") }, "CA10Z1__locationName__c" : "westeurope", "Id" : "002" }, { "context" : { "snapshotTime" : new Date("2025-09-25T05:52:33Z") }, "CA10Z1__locationName__c" : "southeastasia", "Id" : "003" } ]; """; CREATE TEMP FUNCTION process_CA10Z1__CaAzureSqlManagedInstance__c( obj STRUCT< CA10Z1__disappearanceTime__c TIMESTAMP, CA10Z1__locationName__c STRING, Id 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 Azure [CA10Z1__disappearanceTime__c]: ' + obj.CA10Z1__disappearanceTime__c); if (obj.CA10Z1__disappearanceTime__c != null) { return {status: 'DISAPPEARED', conditionIndex: 99, conditionText: "isDisappeared(CA10Z1__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.CA10Z1__locationName__c; } return this.out; }; references1.push('Location Name [obj.CA10Z1__locationName__c]: ' + obj.CA10Z1__locationName__c); if (TextLib.equal(extract3.call(extract3), 'westus')) { return {status: 'INCOMPLIANT', conditionIndex: 199, conditionText: "extract('CA10Z1__locationName__c') == 'westus'", currentStateMessage: "The instance is running in westus which is more expensive than westus3 or westus2.", currentStateReferences: references1.join('\n'), remediation: "Migrate the instance to westus3 or westus2.", runtimeError: null}; } // condition[2], conditionIndex:[200..299] function extract6() { if (!this.out) { this.out = obj.CA10Z1__locationName__c; } return this.out; }; if (TextLib.equal(extract6.call(extract6), 'westcentralus')) { return {status: 'INCOMPLIANT', conditionIndex: 299, conditionText: "extract('CA10Z1__locationName__c') == 'westcentralus'", currentStateMessage: "The instance is running in westcentralus which is more expensive than westus3 or westus2.", currentStateReferences: references1.join('\n'), remediation: "Migrate the instance to westus3 or westus2.", runtimeError: null}; } // condition[3], conditionIndex:[300..399] function extract9() { if (!this.out) { this.out = obj.CA10Z1__locationName__c; } return this.out; }; if (TextLib.equal(extract9.call(extract9), 'southcentralus')) { return {status: 'INCOMPLIANT', conditionIndex: 399, conditionText: "extract('CA10Z1__locationName__c') == 'southcentralus'", currentStateMessage: "The instance is running in southcentralus which is more expensive than northcentralus, westus3 or westus2.", currentStateReferences: references1.join('\n'), remediation: "Migrate the instance to northcentralus, westus3 or westus2.", runtimeError: null}; } // condition[4], conditionIndex:[400..499] function extract12() { if (!this.out) { this.out = obj.CA10Z1__locationName__c; } return this.out; }; if (TextLib.equal(extract12.call(extract12), 'centralus')) { return {status: 'INCOMPLIANT', conditionIndex: 499, conditionText: "extract('CA10Z1__locationName__c') == 'centralus'", currentStateMessage: "The instance is running in centralus which is more expensive than northcentralus, westus3 or westus2.", currentStateReferences: references1.join('\n'), remediation: "Migrate the instance to northcentralus, westus3 or westus2.", runtimeError: null}; } // condition[5], conditionIndex:[500..599] function extract15() { if (!this.out) { this.out = obj.CA10Z1__locationName__c; } return this.out; }; if (TextLib.equal(extract15.call(extract15), 'canadaeast')) { return {status: 'INCOMPLIANT', conditionIndex: 599, conditionText: "extract('CA10Z1__locationName__c') == 'canadaeast'", currentStateMessage: "The instance is running in canadaeast which is more expensive than eastus or eastus2.", currentStateReferences: references1.join('\n'), remediation: "Migrate the instance to eastus or eastus2.", runtimeError: null}; } // condition[6], conditionIndex:[600..699] function extract18() { if (!this.out) { this.out = obj.CA10Z1__locationName__c; } return this.out; }; if (TextLib.equal(extract18.call(extract18), 'canadacentral')) { return {status: 'INCOMPLIANT', conditionIndex: 699, conditionText: "extract('CA10Z1__locationName__c') == 'canadacentral'", currentStateMessage: "The instance is running in canadacentral which is more expensive than eastus or eastus2.", currentStateReferences: references1.join('\n'), remediation: "Migrate the instance to eastus or eastus2.", runtimeError: null}; } // condition[7], conditionIndex:[700..799] function extract21() { if (!this.out) { this.out = obj.CA10Z1__locationName__c; } return this.out; }; if (TextLib.equal(extract21.call(extract21), 'ukwest')) { return {status: 'INCOMPLIANT', conditionIndex: 799, conditionText: "extract('CA10Z1__locationName__c') == 'ukwest'", currentStateMessage: "The instance is running in ukwest which is more expensive than eu-west-1, eu-north-1, or eu-south-2.", currentStateReferences: references1.join('\n'), remediation: "Migrate the instance to eu-west-1, eu-north-1, or eu-south-2.", runtimeError: null}; } // condition[8], conditionIndex:[800..899] function extract24() { if (!this.out) { this.out = obj.CA10Z1__locationName__c; } return this.out; }; if (TextLib.equal(extract24.call(extract24), 'uksouth')) { return {status: 'INCOMPLIANT', conditionIndex: 899, conditionText: "extract('CA10Z1__locationName__c') == 'uksouth'", currentStateMessage: "The instance is running in uksouth which is more expensive than eu-west-1, eu-north-1, or eu-south-2.", currentStateReferences: references1.join('\n'), remediation: "Migrate the instance to eu-west-1, eu-north-1, or eu-south-2.", runtimeError: null}; } // condition[9], conditionIndex:[900..999] function extract27() { if (!this.out) { this.out = obj.CA10Z1__locationName__c; } return this.out; }; if (TextLib.equal(extract27.call(extract27), 'francecentral')) { return {status: 'INCOMPLIANT', conditionIndex: 999, conditionText: "extract('CA10Z1__locationName__c') == 'francecentral'", currentStateMessage: "The instance is running in francecentral which is more expensive than eu-west-1, eu-north-1, or eu-south-2.", currentStateReferences: references1.join('\n'), remediation: "Migrate the instance to eu-west-1, eu-north-1, or eu-south-2.", runtimeError: null}; } // condition[10], conditionIndex:[1000..1099] function extract30() { if (!this.out) { this.out = obj.CA10Z1__locationName__c; } return this.out; }; if (TextLib.equal(extract30.call(extract30), 'francesouth')) { return {status: 'INCOMPLIANT', conditionIndex: 1099, conditionText: "extract('CA10Z1__locationName__c') == 'francesouth'", currentStateMessage: "The instance is running in francesouth which is more expensive than eu-west-1, eu-north-1, or eu-south-2.", currentStateReferences: references1.join('\n'), remediation: "Migrate the instance to eu-west-1, eu-north-1, or eu-south-2.", runtimeError: null}; } // condition[11], conditionIndex:[1100..1199] function extract33() { if (!this.out) { this.out = obj.CA10Z1__locationName__c; } return this.out; }; if (TextLib.equal(extract33.call(extract33), 'westeurope')) { return {status: 'INCOMPLIANT', conditionIndex: 1199, conditionText: "extract('CA10Z1__locationName__c') == 'westeurope'", currentStateMessage: "The instance is running in westeurope which is more expensive than northeurope.", currentStateReferences: references1.join('\n'), remediation: "Migrate the instance to northeurope.", runtimeError: null}; } // condition[12], conditionIndex:[1200..1299] function extract36() { if (!this.out) { this.out = obj.CA10Z1__locationName__c; } return this.out; }; if (TextLib.equal(extract36.call(extract36), 'germanywestcentral')) { return {status: 'INCOMPLIANT', conditionIndex: 1299, conditionText: "extract('CA10Z1__locationName__c') == 'germanywestcentral'", currentStateMessage: "The instance is running in germanywestcentral which is more expensive than northeurope.", currentStateReferences: references1.join('\n'), remediation: "Migrate the instance to northeurope.", runtimeError: null}; } // condition[13], conditionIndex:[1300..1399] function extract39() { if (!this.out) { this.out = obj.CA10Z1__locationName__c; } return this.out; }; if (TextLib.equal(extract39.call(extract39), 'germanynorth')) { return {status: 'INCOMPLIANT', conditionIndex: 1399, conditionText: "extract('CA10Z1__locationName__c') == 'germanynorth'", currentStateMessage: "The instance is running in germanynorth which is more expensive than northeurope.", currentStateReferences: references1.join('\n'), remediation: "Migrate the instance to northeurope.", runtimeError: null}; } // condition[14], conditionIndex:[1400..1499] function extract42() { if (!this.out) { this.out = obj.CA10Z1__locationName__c; } return this.out; }; if (TextLib.equal(extract42.call(extract42), 'switzerlandnorth')) { return {status: 'INCOMPLIANT', conditionIndex: 1499, conditionText: "extract('CA10Z1__locationName__c') == 'switzerlandnorth'", currentStateMessage: "The instance is running in switzerlandnorth which is more expensive than northeurope.", currentStateReferences: references1.join('\n'), remediation: "Migrate the instance to northeurope.", runtimeError: null}; } // condition[15], conditionIndex:[1500..1599] function extract45() { if (!this.out) { this.out = obj.CA10Z1__locationName__c; } return this.out; }; if (TextLib.equal(extract45.call(extract45), 'switzerlandwest')) { return {status: 'INCOMPLIANT', conditionIndex: 1599, conditionText: "extract('CA10Z1__locationName__c') == 'switzerlandwest'", currentStateMessage: "The instance is running in switzerlandwest which is more expensive than northeurope.", currentStateReferences: references1.join('\n'), remediation: "Migrate the instance to northeurope.", runtimeError: null}; } // condition[16], conditionIndex:[1600..1699] function extract48() { if (!this.out) { this.out = obj.CA10Z1__locationName__c; } return this.out; }; if (TextLib.equal(extract48.call(extract48), 'italynorth')) { return {status: 'INCOMPLIANT', conditionIndex: 1699, conditionText: "extract('CA10Z1__locationName__c') == 'italynorth'", currentStateMessage: "The instance is running in italynorth which is more expensive than northeurope.", currentStateReferences: references1.join('\n'), remediation: "Migrate the instance to northeurope.", runtimeError: null}; } // condition[17], conditionIndex:[1700..1799] function extract51() { if (!this.out) { this.out = obj.CA10Z1__locationName__c; } return this.out; }; if (TextLib.equal(extract51.call(extract51), 'polandcentral')) { return {status: 'INCOMPLIANT', conditionIndex: 1799, conditionText: "extract('CA10Z1__locationName__c') == 'polandcentral'", currentStateMessage: "The instance is running in polandcentral which is more expensive than northeurope.", currentStateReferences: references1.join('\n'), remediation: "Migrate the instance to northeurope.", runtimeError: null}; } // condition[18], conditionIndex:[1800..1899] function extract54() { if (!this.out) { this.out = obj.CA10Z1__locationName__c; } return this.out; }; if (TextLib.equal(extract54.call(extract54), 'norwayeast')) { return {status: 'INCOMPLIANT', conditionIndex: 1899, conditionText: "extract('CA10Z1__locationName__c') == 'norwayeast'", currentStateMessage: "The instance is running in norwayeast which is more expensive than northeurope.", currentStateReferences: references1.join('\n'), remediation: "Migrate the instance to northeurope.", runtimeError: null}; } // condition[19], conditionIndex:[1900..1999] function extract57() { if (!this.out) { this.out = obj.CA10Z1__locationName__c; } return this.out; }; if (TextLib.equal(extract57.call(extract57), 'norwaywest')) { return {status: 'INCOMPLIANT', conditionIndex: 1999, conditionText: "extract('CA10Z1__locationName__c') == 'norwaywest'", currentStateMessage: "The instance is running in norwaywest which is more expensive than northeurope.", currentStateReferences: references1.join('\n'), remediation: "Migrate the instance to northeurope.", runtimeError: null}; } // condition[20], conditionIndex:[2000..2099] function extract60() { if (!this.out) { this.out = obj.CA10Z1__locationName__c; } return this.out; }; if (TextLib.equal(extract60.call(extract60), 'swedensouth')) { return {status: 'INCOMPLIANT', conditionIndex: 2099, conditionText: "extract('CA10Z1__locationName__c') == 'swedensouth'", currentStateMessage: "The instance is running in swedensouth which is more expensive than northeurope.", currentStateReferences: references1.join('\n'), remediation: "Migrate the instance to northeurope.", runtimeError: null}; } // condition[21], conditionIndex:[2100..2199] function extract63() { if (!this.out) { this.out = obj.CA10Z1__locationName__c; } return this.out; }; if (TextLib.equal(extract63.call(extract63), 'spaincentral')) { return {status: 'INCOMPLIANT', conditionIndex: 2199, conditionText: "extract('CA10Z1__locationName__c') == 'spaincentral'", currentStateMessage: "The instance is running in spaincentral which is more expensive than northeurope.", currentStateReferences: references1.join('\n'), remediation: "Migrate the instance to northeurope.", runtimeError: null}; } // condition[22], conditionIndex:[2200..2299] function extract66() { if (!this.out) { this.out = obj.CA10Z1__locationName__c; } return this.out; }; if (TextLib.equal(extract66.call(extract66), 'southindia')) { return {status: 'INCOMPLIANT', conditionIndex: 2299, conditionText: "extract('CA10Z1__locationName__c') == 'southindia'", currentStateMessage: "The instance is running in southindia which is more expensive than centralindia or westindia.", currentStateReferences: references1.join('\n'), remediation: "Migrate the instance to centralindia or westindia.", runtimeError: null}; } // condition[23], conditionIndex:[2300..2399] function extract69() { if (!this.out) { this.out = obj.CA10Z1__locationName__c; } return this.out; }; if (TextLib.equal(extract69.call(extract69), 'japanwest')) { return {status: 'INCOMPLIANT', conditionIndex: 2399, conditionText: "extract('CA10Z1__locationName__c') == 'japanwest'", currentStateMessage: "The instance is running in japanwest which is more expensive than koreasouth, japaneast or koreacentral.", currentStateReferences: references1.join('\n'), remediation: "Migrate the instance to koreasouth, japaneast or koreacentral.", runtimeError: null}; } return {status: 'COMPLIANT', conditionIndex: 2400, conditionText: "otherwise", currentStateMessage: "The instance is located in a cost-effective region.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}; """; SELECT expectedResult.Id as Id, IF ( IFNULL(expectedResult.expectedResult.status, '') = IFNULL(sObject.result.status, '') AND IFNULL(expectedResult.expectedResult.conditionIndex, -1) = IFNULL(sObject.result.conditionIndex, -1) AND IFNULL(expectedResult.expectedResult.conditionText, '') = IFNULL(sObject.result.conditionText, '') AND IFNULL(expectedResult.expectedResult.runtimeError, '') = IFNULL(sObject.result.runtimeError, ''), "MATCH", "FAIL" ) as match, expectedResult.expectedResult.status as expectedStatus, sObject.result.status as actualStatus, expectedResult.expectedResult.conditionIndex as expectedConditionIndex, sObject.result.conditionIndex as actualConditionIndex, expectedResult.expectedResult.conditionText as expectedConditionText, sObject.result.conditionText as actualConditionText, expectedResult.expectedResult.runtimeError as expectedRuntimeError, sObject.result.runtimeError as actualRuntimeError FROM UNNEST(mock_ExpectedResult()) expectedResult LEFT JOIN ( SELECT sObject.CA10Z1__disappearanceTime__c AS CA10Z1__disappearanceTime__c, sObject.CA10Z1__locationName__c AS CA10Z1__locationName__c, sObject.Id AS Id, process_CA10Z1__CaAzureSqlManagedInstance__c( STRUCT( sObject.CA10Z1__disappearanceTime__c AS CA10Z1__disappearanceTime__c, sObject.CA10Z1__locationName__c AS CA10Z1__locationName__c, sObject.Id AS Id ), sObject.context.snapshotTime ) as result FROM UNNEST(mock_CA10Z1__CaAzureSqlManagedInstance__c()) AS sObject ) sObject ON sObject.Id = expectedResult.Id;