--- policy: /ce/ca/azure/mysql-database/server-cost-effective-region logic: /ce/ca/azure/mysql-database/server-cost-effective-region/prod.logic.yaml executionTime: 2026-02-10T22:33:32.454964896Z generationMs: 74 executionMs: 799 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: 2800 actual: 2800 conditionText: expected: otherwise actual: otherwise runtimeError: {} usedFiles: - path: /ce/ca/azure/mysql-database/server-cost-effective-region/policy.yaml md5Hash: 0412FE115A83BF145C3F1229079968B3 content: | --- names: full: "Azure MySQL Server is located in a less cost-effective region" contextual: "Server is located in a less cost-effective region" description: "This policy flags MySQL Server 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/mysql-database/server-cost-effective-region/prod.logic.yaml md5Hash: 9A825EB4841820274504B6178C8A5ABD content: | --- inputType: "CA10Z1__CaAzureMySqlServer__c" importExtracts: - file: "/types/CA10Z1__CaAzureMySqlServer__c/object.extracts.yaml" testData: - file: 'test-data.json' conditions: - status: "INCOMPLIANT" currentStateMessage: "The server is running in westus which is more expensive than westus3 or westus2." remediationMessage: "Migrate the server to westus3 or westus2." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "westus" - status: "INCOMPLIANT" currentStateMessage: "The server is running in westcentralus which is more expensive than westus3 or westus2." remediationMessage: "Migrate the server to westus3 or westus2." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "westcentralus" - status: "INCOMPLIANT" currentStateMessage: "The server is running in southcentralus which is more expensive than northcentralus, westus3 or westus2." remediationMessage: "Migrate the server to northcentralus, westus3 or westus2." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "southcentralus" - status: "INCOMPLIANT" currentStateMessage: "The server is running in centralus which is more expensive than northcentralus, westus3 or westus2." remediationMessage: "Migrate the server to northcentralus, westus3 or westus2." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "centralus" - status: "INCOMPLIANT" currentStateMessage: "The server is running in canadaeast which is more expensive than eastus or eastus2." remediationMessage: "Migrate the server to eastus or eastus2." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "canadaeast" - status: "INCOMPLIANT" currentStateMessage: "The server is running in canadacentral which is more expensive than eastus or eastus2." remediationMessage: "Migrate the server to eastus or eastus2." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "canadacentral" - status: "INCOMPLIANT" currentStateMessage: "The server is running in ukwest which is more expensive than eu-west-1, eu-north-1, or eu-south-2." remediationMessage: "Migrate the server 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 server is running in uksouth which is more expensive than eu-west-1, eu-north-1, or eu-south-2." remediationMessage: "Migrate the server 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 server is running in francecentral which is more expensive than eu-west-1, eu-north-1, or eu-south-2." remediationMessage: "Migrate the server 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 server is running in francesouth which is more expensive than eu-west-1, eu-north-1, or eu-south-2." remediationMessage: "Migrate the server 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 server is running in westeurope which is more expensive than swedencentral or northeurope." remediationMessage: "Migrate the server to swedencentral or northeurope." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "westeurope" - status: "INCOMPLIANT" currentStateMessage: "The server is running in germanywestcentral which is more expensive than swedencentral or northeurope." remediationMessage: "Migrate the server to swedencentral or northeurope." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "germanywestcentral" - status: "INCOMPLIANT" currentStateMessage: "The server is running in germanynorth which is more expensive than swedencentral or northeurope." remediationMessage: "Migrate the server to swedencentral or northeurope." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "germanynorth" - status: "INCOMPLIANT" currentStateMessage: "The server is running in switzerlandnorth which is more expensive than swedencentral or northeurope." remediationMessage: "Migrate the server to swedencentral or northeurope." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "switzerlandnorth" - status: "INCOMPLIANT" currentStateMessage: "The server is running in switzerlandwest which is more expensive than swedencentral or northeurope." remediationMessage: "Migrate the server to swedencentral or northeurope." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "switzerlandwest" - status: "INCOMPLIANT" currentStateMessage: "The server is running in italynorth which is more expensive than swedencentral or northeurope." remediationMessage: "Migrate the server to swedencentral or northeurope." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "italynorth" - status: "INCOMPLIANT" currentStateMessage: "The server is running in polandcentral which is more expensive than swedencentral or northeurope." remediationMessage: "Migrate the server to swedencentral or northeurope." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "polandcentral" - status: "INCOMPLIANT" currentStateMessage: "The server is running in norwayeast which is more expensive than swedencentral or northeurope." remediationMessage: "Migrate the server to swedencentral or northeurope." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "norwayeast" - status: "INCOMPLIANT" currentStateMessage: "The server is running in norwaywest which is more expensive than swedencentral or northeurope." remediationMessage: "Migrate the server to swedencentral or northeurope." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "norwaywest" - status: "INCOMPLIANT" currentStateMessage: "The server is running in swedensouth which is more expensive than swedencentral or northeurope." remediationMessage: "Migrate the server to swedencentral or northeurope." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "swedensouth" - status: "INCOMPLIANT" currentStateMessage: "The server is running in spaincentral which is more expensive than swedencentral or northeurope." remediationMessage: "Migrate the server to swedencentral or northeurope." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "spaincentral" - status: "INCOMPLIANT" currentStateMessage: "The server is running in australiasoutheast which is more expensive than australiacentral or australiacentral2." remediationMessage: "Migrate the server to australiacentral or australiacentral2." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "australiasoutheast" - status: "INCOMPLIANT" currentStateMessage: "The server is running in australiaeast which is more expensive than australiacentral or australiacentral2." remediationMessage: "Migrate the server to australiacentral or australiacentral2." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "australiaeast" - status: "INCOMPLIANT" currentStateMessage: "The server is running in japaneast which is more expensive than koreasouth." remediationMessage: "Migrate the server to koreasouth." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "japaneast" - status: "INCOMPLIANT" currentStateMessage: "The server is running in japanwest which is more expensive than koreasouth." remediationMessage: "Migrate the server to koreasouth." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "japanwest" - status: "INCOMPLIANT" currentStateMessage: "The server is running in koreacentral which is more expensive than koreasouth." remediationMessage: "Migrate the server to koreasouth." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "koreacentral" - status: "INCOMPLIANT" currentStateMessage: "The server is running in austriaeast which is more expensive than swedencentral or northeurope." remediationMessage: "Migrate the server to swedencentral or northeurope." check: IS_EQUAL: left: EXTRACT: CA10Z1__locationName__c right: TEXT: "austriaeast" otherwise: status: "COMPLIANT" currentStateMessage: "The server is located in a cost-effective region." - path: /ce/ca/azure/mysql-database/server-cost-effective-region/test-data.json md5Hash: 8365CFA65B8C5155D8FD35B8FE0050CC content: | [ { "expectedResult": { "status": "DISAPPEARED", "conditionIndex": "99", "conditionText": "isDisappeared(CA10Z1__disappearanceTime__c)", "runtimeError": null }, "context": { "snapshotTime": "2025-09-24T02:10:07Z" }, "Id": "001", "CA10Z1__disappearanceTime__c": "2025-09-15T05:52:54Z", "CA10Z1__locationName__c": "westeurope" }, { "expectedResult": { "status": "INCOMPLIANT", "conditionIndex": "1199", "conditionText": "extract('CA10Z1__locationName__c') == 'westeurope'", "runtimeError": null }, "context": { "snapshotTime": "2025-09-24T02:10:07Z" }, "Id": "002", "CA10Z1__disappearanceTime__c": null, "CA10Z1__locationName__c": "westeurope" }, { "expectedResult": { "status": "COMPLIANT", "conditionIndex": "2800", "conditionText": "otherwise", "runtimeError": null }, "context": { "snapshotTime": "2025-09-24T02:10:07Z" }, "Id": "003", "CA10Z1__disappearanceTime__c": null, "CA10Z1__locationName__c": "eastus" } ] - path: /types/CA10Z1__CaAzureMySqlServer__c/object.extracts.yaml md5Hash: 2B2178E89E751C1A0E34592D0E5F46C4 content: "---\nextracts:\n# Values: Enabled, Disabled. Not Nullable. Can't have\ \ no access, retrieved via Microsoft.DBforMySQL/servers/read\n - name: \"CA10Z1__sslEnforcement__c\"\ \n value: \n FIELD:\n path: \"CA10Z1__sslEnforcement__c\"\n \ \ undeterminedIf:\n isEmpty: \"Corrupted Data. MySQL Server SSL\ \ Enforcement cannot be empty.\"\n# Values: TLS1_0, TLS1_1, TLS1_2, TLSEnforcementDisabled.\ \ Not Nullable. Can't have no access, retrieved via Microsoft.DBforMySQL/servers/read\n\ \ - name: \"CA10Z1__minimalTlsVersion__c\"\n value: \n FIELD:\n \ \ path: \"CA10Z1__minimalTlsVersion__c\"\n undeterminedIf:\n \ \ isEmpty: \"Corrupted Data. MySQL Server Minimal TLS Version cannot be\ \ empty.\"\n - name: \"CA10Z1__deploymentMode__c\"\n value: \n FIELD:\n\ \ path: \"CA10Z1__deploymentMode__c\"\n undeterminedIf:\n \ \ isEmpty: \"Corrupted Data. MySQL Deployment Mode cannot be empty.\"\n\ # Not nullable\n - name: \"CA10Z1__configurations__c\"\n value:\n FIELD:\n\ \ path: \"CA10Z1__configurations__c\"\n returnType: BYTES\n \ \ undeterminedIf:\n noAccessDelegate:\n path: \"CA10Z1__configurations__c\"\ \n currentStateMessage: \"Unable to determine Server Configurations.\ \ Possible permission issue with Microsoft.DBforPostgreSQL/servers/configurations/read\"\ \n - name: \"caJsonFrom__configurations__c\"\n value: \n JSON_FROM:\n\ \ arg: \n EXTRACT: \"CA10Z1__configurations__c\"\n undeterminedIf:\n\ \ isInvalid: \"Configurations JSON is invalid.\"\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__monitorMemoryPercentAvg30Day__c\"\n value:\ \ \n FIELD:\n path: \"CA10Z1__monitorMemoryPercentAvg30Day__c\"\n\ # Nullable \n - name: \"CA10Z1__monitorIoConsumptionPercentAvg30Day__c\"\n\ \ value: \n FIELD:\n path: \"CA10Z1__monitorIoConsumptionPercentAvg30Day__c\"\ \n - name: \"CA10Z1__locationName__c\"\n value: \n FIELD:\n \ \ path: \"CA10Z1__locationName__c\"\n\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" : "2800", "conditionText" : "otherwise", "runtimeError" : null } } ]; """; CREATE TEMP FUNCTION mock_CA10Z1__CaAzureMySqlServer__c() RETURNS ARRAY >> DETERMINISTIC LANGUAGE js AS r""" return [ { "context" : { "snapshotTime" : new Date("2025-09-24T02:10:07Z") }, "CA10Z1__disappearanceTime__c" : new Date("2025-09-15T05:52:54Z"), "CA10Z1__locationName__c" : "westeurope", "Id" : "001" }, { "context" : { "snapshotTime" : new Date("2025-09-24T02:10:07Z") }, "CA10Z1__locationName__c" : "westeurope", "Id" : "002" }, { "context" : { "snapshotTime" : new Date("2025-09-24T02:10:07Z") }, "CA10Z1__locationName__c" : "eastus", "Id" : "003" } ]; """; CREATE TEMP FUNCTION process_CA10Z1__CaAzureMySqlServer__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 server is running in westus which is more expensive than westus3 or westus2.", currentStateReferences: references1.join('\n'), remediation: "Migrate the server 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 server is running in westcentralus which is more expensive than westus3 or westus2.", currentStateReferences: references1.join('\n'), remediation: "Migrate the server 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 server is running in southcentralus which is more expensive than northcentralus, westus3 or westus2.", currentStateReferences: references1.join('\n'), remediation: "Migrate the server 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 server is running in centralus which is more expensive than northcentralus, westus3 or westus2.", currentStateReferences: references1.join('\n'), remediation: "Migrate the server 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 server is running in canadaeast which is more expensive than eastus or eastus2.", currentStateReferences: references1.join('\n'), remediation: "Migrate the server 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 server is running in canadacentral which is more expensive than eastus or eastus2.", currentStateReferences: references1.join('\n'), remediation: "Migrate the server 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 server 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 server 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 server 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 server 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 server 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 server 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 server 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 server 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 server is running in westeurope which is more expensive than swedencentral or northeurope.", currentStateReferences: references1.join('\n'), remediation: "Migrate the server to swedencentral or 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 server is running in germanywestcentral which is more expensive than swedencentral or northeurope.", currentStateReferences: references1.join('\n'), remediation: "Migrate the server to swedencentral or 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 server is running in germanynorth which is more expensive than swedencentral or northeurope.", currentStateReferences: references1.join('\n'), remediation: "Migrate the server to swedencentral or 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 server is running in switzerlandnorth which is more expensive than swedencentral or northeurope.", currentStateReferences: references1.join('\n'), remediation: "Migrate the server to swedencentral or 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 server is running in switzerlandwest which is more expensive than swedencentral or northeurope.", currentStateReferences: references1.join('\n'), remediation: "Migrate the server to swedencentral or 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 server is running in italynorth which is more expensive than swedencentral or northeurope.", currentStateReferences: references1.join('\n'), remediation: "Migrate the server to swedencentral or 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 server is running in polandcentral which is more expensive than swedencentral or northeurope.", currentStateReferences: references1.join('\n'), remediation: "Migrate the server to swedencentral or 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 server is running in norwayeast which is more expensive than swedencentral or northeurope.", currentStateReferences: references1.join('\n'), remediation: "Migrate the server to swedencentral or 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 server is running in norwaywest which is more expensive than swedencentral or northeurope.", currentStateReferences: references1.join('\n'), remediation: "Migrate the server to swedencentral or 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 server is running in swedensouth which is more expensive than swedencentral or northeurope.", currentStateReferences: references1.join('\n'), remediation: "Migrate the server to swedencentral or 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 server is running in spaincentral which is more expensive than swedencentral or northeurope.", currentStateReferences: references1.join('\n'), remediation: "Migrate the server to swedencentral or 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), 'australiasoutheast')) { return {status: 'INCOMPLIANT', conditionIndex: 2299, conditionText: "extract('CA10Z1__locationName__c') == 'australiasoutheast'", currentStateMessage: "The server is running in australiasoutheast which is more expensive than australiacentral or australiacentral2.", currentStateReferences: references1.join('\n'), remediation: "Migrate the server to australiacentral or australiacentral2.", 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), 'australiaeast')) { return {status: 'INCOMPLIANT', conditionIndex: 2399, conditionText: "extract('CA10Z1__locationName__c') == 'australiaeast'", currentStateMessage: "The server is running in australiaeast which is more expensive than australiacentral or australiacentral2.", currentStateReferences: references1.join('\n'), remediation: "Migrate the server to australiacentral or australiacentral2.", runtimeError: null}; } // condition[24], conditionIndex:[2400..2499] function extract72() { if (!this.out) { this.out = obj.CA10Z1__locationName__c; } return this.out; }; if (TextLib.equal(extract72.call(extract72), 'japaneast')) { return {status: 'INCOMPLIANT', conditionIndex: 2499, conditionText: "extract('CA10Z1__locationName__c') == 'japaneast'", currentStateMessage: "The server is running in japaneast which is more expensive than koreasouth.", currentStateReferences: references1.join('\n'), remediation: "Migrate the server to koreasouth.", runtimeError: null}; } // condition[25], conditionIndex:[2500..2599] function extract75() { if (!this.out) { this.out = obj.CA10Z1__locationName__c; } return this.out; }; if (TextLib.equal(extract75.call(extract75), 'japanwest')) { return {status: 'INCOMPLIANT', conditionIndex: 2599, conditionText: "extract('CA10Z1__locationName__c') == 'japanwest'", currentStateMessage: "The server is running in japanwest which is more expensive than koreasouth.", currentStateReferences: references1.join('\n'), remediation: "Migrate the server to koreasouth.", runtimeError: null}; } // condition[26], conditionIndex:[2600..2699] function extract78() { if (!this.out) { this.out = obj.CA10Z1__locationName__c; } return this.out; }; if (TextLib.equal(extract78.call(extract78), 'koreacentral')) { return {status: 'INCOMPLIANT', conditionIndex: 2699, conditionText: "extract('CA10Z1__locationName__c') == 'koreacentral'", currentStateMessage: "The server is running in koreacentral which is more expensive than koreasouth.", currentStateReferences: references1.join('\n'), remediation: "Migrate the server to koreasouth.", runtimeError: null}; } // condition[27], conditionIndex:[2700..2799] function extract81() { if (!this.out) { this.out = obj.CA10Z1__locationName__c; } return this.out; }; if (TextLib.equal(extract81.call(extract81), 'austriaeast')) { return {status: 'INCOMPLIANT', conditionIndex: 2799, conditionText: "extract('CA10Z1__locationName__c') == 'austriaeast'", currentStateMessage: "The server is running in austriaeast which is more expensive than swedencentral or northeurope.", currentStateReferences: references1.join('\n'), remediation: "Migrate the server to swedencentral or northeurope.", runtimeError: null}; } return {status: 'COMPLIANT', conditionIndex: 2800, conditionText: "otherwise", currentStateMessage: "The server 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__CaAzureMySqlServer__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__CaAzureMySqlServer__c()) AS sObject ) sObject ON sObject.Id = expectedResult.Id;